Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is Entity Framework 4's POCO support compared to NHibernate?

Just wondering if anyone has had any experience using Entity Framework 4's POCO support and how it stands up compared to NHibernate. If they're the same, I'd be very interested in making Entity Framework 4 my ORM of choice if only because it would:

  1. Support both data first AND object first development
  2. Have a robust LINQ provider
  3. Be easier to pitch to clients (since it's developed by Microsoft)
  4. Come baked into the .NET framework rather than requiring 8 dlls to get up and running

In other words, are there any major shortcomings to EF4?

Does it support all of the basic functionality NHibernate supports (lazy-loading, eager-loading, 1st level caching, etc.) or is it still rough around the edges? Is the syntax for setting up the mappings as easy as NHibernate and/or Fluent NHibernate?

Edit: Please don't bring up the vote of no confidence. That was ages ago and dealt with some serious shortcomings of EF1 that really don't seem to apply anymore to EF4.

like image 590
Kevin Pang Avatar asked Apr 15 '10 17:04

Kevin Pang


1 Answers

It looks like Ayende has a pretty detailed blog post comparing the two, although he admits it's not a thorough point-by-point breakdown (which is kind of what I was hoping for here).

In general, I think the points he brings up in favor of NHibernate are valid, albeit a bit on the "nice to have" side. If this is really where EF4 is currently lacking, it sounds like EF4 is a great alternative to NHibernate if only for the reasons I listed in the original question.

like image 156
Kevin Pang Avatar answered Nov 08 '22 21:11

Kevin Pang