SEARCH:   GO
{Blog entries}
Mar 24

Written by: Javier Callico
3/24/2010  RssIcon

For the last two weeks I've had the opportunity to work on a project which uses Entity Framework (EF) ver. 1.0. For more than a year I've been reading complains, reviews and comparisons regarding EF but finally after using it I have my own opinion:

  • It's not a mature solution.
  • Definitely falls short when compared to other products in the same category, like NHibernate for example.
  • It's not as bad as some people want to make it appear.
  • Can help some teams deliver small projects on time, especially if the developers have no experience on the use of O/R mapping tools or if like in the project I was working on, most of the business logic was implemented on the database side.

Things I like about EF:

  • The designer integrated into VS works well. All the classes can be created and recreated with a single click.
  •  Works well with projects where most of the business logic resides on the database side. Entities can be loaded and saved using stored procedures.

Things I don't like about EF:

  • Support for POCO objects not native.
  • Some of the operations supported by the designer are not very intuitive, at least for me, for example: I had to consult some online articles to get a FK relationship right.
  • Attaching detached entities is not a trivial operation and can get really messy. This particular issue took lots of time from me. On my particular project some entities are persisted on the HTTP session collection and I had to use a custom hack in order to reattach them back to a data context.
  • Lazy loading support is not native. All associations need to be eagerly loaded with the main entity or explicitly loaded when needed.

Many of the shortcomings of the first version of EF, like lazy loading, will be addressed by the upcoming version 4 to be released this spring. Others will still remain making this technology inferior to products like NHibernate, at least for now.

This post by Ayende outlines some other shortcomings from the perspective of a more advanced and knowledgeable user.

Note: I'll keep updating this article as I keep working with the EF.

Last update: 03/24/2010

Tags: .NET , EF
Categories:

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel