Friday, April 6, 2012

Entity Framework Futures

Entity Framework Futures
Tim Mallalieu ’ s “ Entity Framework Futures ” session for the Microsoft Professional Developers
Conference (PDC) 2008 outlined in more detail what developers can expect from EF v2 and other future
Entity Data Model implementations. (You can view the Channel9 video of the presentation at http://
channel9.msdn.com/pdc2008/TL20/ ).
Mallalieu emphasized that data access is the first EDM implementation, but the Entity Data Platform
(EDP) will ultimately manage the following domains:
  • ·         Data access and object persistence (EF)
  • ·         Integration, aggregation, and synchronization
  • ·         Reporting and analytics
  • ·         Data management, deployment, policy, and security
  • ·         Models and workflows
These scenarios will be supported by four primary EDP technology categories:
  • ·         Client technologies
  • ·         Mid - tier frameworks and technologies
  • ·         Data access APIs and frameworks
  • ·         Core storage
Data consumers fall into the following segments, each with their own needs in the preceding domains
and technologies:
  • ·         Traditional data developers
  • ·         Developers using scripting and “ rebel frameworks, ” such as agile programming
  • ·         Model - centric data developers
  • ·         Line of business (LOB) script or macro writers
  • ·         Information workers

To satisfy agile programmers who insist on plain old CLR objects (POCOs) and total persistence
ignorance, Mallalieu demonstrated writing class code for POCOs and an ObjectContext in the simplest
possible, convention - oriented way. This approach eliminates the EDM and its XML files, and defines an
ObjectSet that implements Iqueryable to deliver completely persistence ignorant code. Adding
mapping attributes enables configuration - oriented code to specify mapping to tables in other schemas or
with column names that don ’ t correspond to property names.
Model - centric developers want to define a model with the EDM Designer and then generate the
database from the model in a manner similar to that employed by LINQ to SQL. EF v2 will add this
capability, which (unfortunately) destroys all data in the database, as well as the capability to define
complex types and implement them by a new “ Artifact Generation Pipeline ” that combines Windows
Workflow and T4 templates. This feature enables developers to modify the workflow, customize the
templates, and build their own design tooling.
Framework developers are independent software vendors (ISVs) who want to build out a data access
layer that leverages the EDM. For example a DBA might create the EDM and the framework developer
would use the *.edmx model to generate POCO classes and enable lazy loading, which was missing from
v1. To prevent the need for direct access to database tables, EF v2 will enable SQL Server table - valued
functions as a data source for composable LINQ to SQL queries, which stored procedures don ’ t support.
New model - defined functions (MDFs) let developers add function definitions, such as FullName() , to
the model. You define MDFs in code, add the SQL expression in the *.edmx file; the expression tree
executes the expression in - line.
Finally, a new feature nicknamed “ Slambda ” lets you use a DbExpression or comprehension syntax to
build a query tree which returns a ADO.NET DbDataReader instead of a typed collection. Beyond v2,
EF and EDM will become a part of the forthcoming Oslo modeling framework with an MEntity domain -
specific grammar. Missing from the presentation was an example of n - tier deployment of EF without the
added overhead of an ADO.NET Data Services (Astoria) layer, as well as support for Contains and
enums, which the DP team won ’ t commit to including in v2.

No comments:

Post a Comment