New Posts New Posts RSS Feed: DevForce EF (DevForce v4) Beta 1: Entities that span 1 or more tables
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

DevForce EF (DevForce v4) Beta 1: Entities that span 1 or more tables

 Post Reply Post Reply
Author
AdamC View Drop Down
Newbie
Newbie
Avatar

Joined: 04-Feb-2008
Location: United States
Posts: 20
Post Options Post Options   Quote AdamC Quote  Post ReplyReply Direct Link To This Post Topic: DevForce EF (DevForce v4) Beta 1: Entities that span 1 or more tables
    Posted: 07-Mar-2008 at 2:37pm
In a recent webinar, Ward talked about Entities and how they can span tables (similar to the way a database View can span more than one table).  I totally agree with this and have been looking forward to a product that delivers this feature.  However, like most ORM tools, I can only seem to create entities that have a 1-to-1 mapping to their underlying tables.  Is there a way to create entities that span 1 or more tables in either the Microsoft EF tool or the DevForce EF Beta 1 product?  When I go to create an entity in the Microsoft EF tool, I can only create one entity per table.  Then when I use use the DevForce EF Beta1 object mapper to create DevForce entities from the Microsoft EF (.edmx) file, I can only create one entity per Microsoft EF entity.  Basically this amounts to DevForce entities having a 1-to-1 mapping with tables.

Am I missing something, or do I need to create custom code to make a business object/ entity span multiple tables?

This may not be a big deal for some who don't mind creating business objects that have a 1-to-1 mapping with their tables, but we would really like our business object model to reflect real-world objects and not relational database structures.  Thanks for any input!

By the way, the DevForce EF beta is looking good and thanks for making it available!!!!




Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 09-Mar-2008 at 7:22pm

Thanks for being an early adopter of DevForce EF (DEF).

First, a digression on what you see vs. what you really get. Smile

There's currently a bit of lag between what the EDMX designer supports vs. what the Entity Framework actually supports.  For instance, the EF supports complex types, while the designer does not.  The EF also supports TPH (table per hierarchy), TPT (table per type) and TPC (table per concrete type) forms of inheritance, while the designer support is incomplete. 

The Beta1 DevForce Object Mapper also lags quite a bit behind what the runtime actually supports.  The Object Mapper at present provides a grid-like display of entities for easier editing, automatic pluralization, support for verification, and a few other DevForce-specific options.  It has no support for complex types, inheritance, or stored procedures, while the DevForce runtime definitely supports all of these features.

So on the question of 1-1 mapping.  I think Ward's comment was in regard to the ability to partition a table into multiple entities, something supported in DevForce 3.x.  You're correct that neither EF nor DEF supports this type of mapping today,
or at least not without some clever workarounds.

But the EF (and by extension DEF) is really fairly rich in the mapping support it does offer right now.  I mentioned inheritance, but views and stored procedures are also supported, and the CUD sproc support is quite good.  There's also something called a "defining query" you can specify in the SSDL which Michael Pizzo from Microsoft described as the "ultimate escape hatch" for mapping scenarios not currently directly supported.

One more thing I want to add.  The DevForce EF runtime supports exactly what the EF runtime supports with regard to database data sources.  We leave the heavy lifting to Microsoft in terms of actual database access, which also means that we rely upon the mapping capabilities of the EF.  Since both DEF and EF are still in beta, and at the beginning of what will hopefully be a long product lifetime, there will be many, many enhancements coming.

 

 


 

Back to Top
AdamC View Drop Down
Newbie
Newbie
Avatar

Joined: 04-Feb-2008
Location: United States
Posts: 20
Post Options Post Options   Quote AdamC Quote  Post ReplyReply Direct Link To This Post Posted: 10-Mar-2008 at 6:39am

Thanks so much for the detailed response!  I appreciate you providing some background and what to expect in the future. 

Originally posted by kimj

So on the question of 1-1 mapping.  I think Ward's comment was in regard to the ability to partition a table into multiple entities, something supported in DevForce 3.x. 

About 5min, 30 sec into Ward's presentation, Ward talks about both 1 entity spanning multiple tables AND 3 entities mapped to a single table (striped).  This portion of the presentation was probably more conceptual at this point and, like you said, not currently supported in the product.  I am still hopeful that this can be accomplished at some point (especially using a designer)!  Wink  However, DEF and EF still offer so much that it is not a show-stopper.

I am very encouraged by what I am seeing so far in both DEF and EF.  I also recognize the benefits of DevForce and how it extends the EF functionality.  Like you said, both DEF and EF are still in beta and should have many enhancements coming over the product's lifetime.  Thanks again!



Edited by AdamC - 10-Mar-2008 at 6:39am
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down