BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Entity Framework CTP for VS 2010

Entity Framework CTP for VS 2010

This item in japanese

Not everything planned for Visual Studio 2010 made it in beta 1. This includes some important features for ORM fans. Entity Framework CTP 1 includes support for Self Tracking Entities, POCO Templates, and support for EDMX-free coding.

Self Tracking Entities are entities that include internal change tracking. The primary use case is remote clients that communicate via WCF. Changes are tracked locally, then the change graph is sent back to the server. Once on the server, the changes are validated and saved to the database using Entity Framework. Diego Vega writes,

The main goal behind designing self tracking entities as POCO classes is that they don’t require Entity Framework to be used on the client computer in distributed scenarios. In order to facilitate working with self tracking entities when they are serialized on the client, we are going to share the code for the types themselves between the service and the client.

Potentially, we could adapt self tracking entities to work with versions of the CLR that do not contain Entity Framework at all, such as Silverlight 3.

Next up is POCO Templates. POCO templates still operate on EDMX files, but they divide the template into two parts. The first template generates the data classes themselves and the FixupCollection class needed to track changes. The second template generates the ObjectContext needed for interacting with a database.

By splitting the template into two, one part that generates the Entities and ComplexTypes and one that generates a strongly typed context, it makes it possible not only to have Entities and ComplexType that are persistence ignorant but further to put those classes in an assembly / project that has no persistence aware code in it at all.

The last headline feature is known as “Code Only”. Essentially the feature allows you to use Entity Framework without EDMX files. This feature is still in the early stages and has numerous limitations such as ManyToMany relationships not being supported.

Rate this Article

Adoption
Style

BT