Another Entity Framework Beta

Yesterday the ADO.NET team announced Beta 2 of the much anticipated Entity Framework and support tools.  Whilst the initial impressions from using the new designer were good, it quickly became evident that the necessary "back-to-the-drawing-board" has really cost the team. 

For example in previous CTPs you could convince the framework to talk with a SQL Server Compact Edition database by simply modifying the app.config file - this no longer works.  Connecting to the AdventureWorks database mostly works but there are fields that it fails to wire up correctly.

Interestingly enough, in previous versions the entity framework was driven by model files with code being dynamically generated straight into an assembly.  In this beta a designer file is generated which contains the class definitions.  Also, the three model files have now been combined into a single .edmx file, although the three sections are still evident in the xml schema. 

Imho the whole entity framework doesn't go far enough - there should be a divide between your class model (ie what gets compiled into your assembly) and your data model (ie what is in the database and might need to be changed in isolation from your application).  The latter should be deployed with your application and the entity framework should dynamically load the mapping between the data store and your classes at runtime.  This would decouple your application from any schema changes such that any change would simply require a change to the mapping.

Published Tuesday, August 28, 2007 2:03 AM by nick

Comments

Tuesday, August 28, 2007 10:25 AM by Daniel Simmons

# re: Another Entity Framework Beta

I'd like to address some of the issues you bring up...  

First, we definitely have folks working successfully with SQL Server Compact Edition.  Can you give more details about the problems you are encountering?

Secondly, it's important to realize that the edmx (designer) file is really just used at design time.  The runtime still uses three separate files (one describing the database schema, one describing the conceptual model and one giving hte mapping between the two).  Those files can be compiled into an assembly as resources or can be delivered individually, so that there can be significant separation between your classes which are built around the conceptual model and the metadata that describes your database (which does, as you say, change at a different rate).

- Danny