Freigeben über


Entity Framework starting points

I was recently asked what a high level list of good starting points for the Entity Framework is. This is a tough question as there are a lot of areas to cover. I've put together a list that I think makes sense from my perspective, which is tilted towards gaining an understanding of the model and the relational mapping, as opposed to getting up and running quickly. Most of the links refer to other blog posts, as these are the resources that I am familiar with.

Understanding the model
The core the Entity Framework is the Entity Data Model. This is what makes the Entity Framework a data platform, as opposed to another ORM mapper. So it follows that the key to understanding the Entity Framework is to understand EDM. It's not always an easy model to understand, especially when you have to look at XML files (keep your eye out for a better way soon), but learning the raw does have benefits. A lot of the time the model will simply use relational ideas, but there is a lot more possible with this model. In particular, with the way that associations are defined, we can actually do some very things that require associations to be a first class idea. These two posts are a great place to start.  
Entity Data Model 101 : Part 1
Entity Data Model 101 : Part 2

Mapping and Metadata
The first version of the Entity Framework is really a system by which the EDM can interact with a database. This is where the ORMness of the EF comes in. To understand how this works, another one of the 101 posts is a good place to start. However, read these as a introduction, not a bible, as with Beta 2 of the Entity Framework, a lot will be changing with what you can do.
Mapping 101 : Part 1
Mapping 101 : Part 2

Querying
Finally, in order to play with the bits, you need a way to query the EF. There are a couple of different ways that you can do this, but from a pure model understanding perspective, I would recommend starting with Entity Client and Entity SQL.

What's missing?  
From a intro course in the Entity Framework, this is where I would start. So what about Object Services, LINQ to Entities, and actually using this technology in an application? After all, not many people want to use Entity Client all the time, and one of the cool points of the EF is the ability to actually do OOP with a database. Does this mean that I recommend using Entity SQL over LINQ to Entities? Not at all; in fact I think that most people will use LINQ to Entities in combination with Object Services. However, I think that details and issues surrounding things like code generation and ObjectQueries are actually distractions when you are trying to understand the model and mapping. Remember, the EDM is the middle layer, between your object layer and your database, and so by looking at the EDM down you get a better view then if you have look from above the object layer.

Do you have a resource that you found was really good? If so, please let me know!

Thanks,
Erick

Comments

  • Anonymous
    July 31, 2007
    Thanks a lot Erick, I've been waiting for a post like this for a while now :)