views:

213

answers:

2

Please if you have used NHibernate and Entity Frameworks, please contrast your experiences.

+3  A: 

You might also consider looking at Castle ActiveRecord, which is a layer on top of NHibernate. It makes the whole ORM thing sparkle, in my opinion.

Brian Genisio
What were those areas where Castle ActiveRecord was an advantage?
David Robbins
ActiveRecord makes configuration a breeze. You don't configure with XML files anymore, but you decorate your classes instead. It manages lazy loading really well, and allows you to do things like myObject.Save().
Brian Genisio
+3  A: 

We were early adopters of LINQ to SQL, but only on a limited basis while waiting for the Entity Framework. We have only started working with EF, but my largest complaint is still the same one that I had with LINQ to SQL, being that my domain model is still married to either the data source or the framework, meaning my POCOs are not really as independent as they should be.

Of course, on the Entity Framework Design blog, they have recognized that persistence ignorance is a very popular requested feature (and will be in the next release), and there is at least one example of how to achieve persistence ignorance while using true POCOs here.

We also evaluated NHibernate. It is very solid and easy to use. Realistically, with all other things being equal, NHibernate is better established but I have a personal preference to stick with the Microsoft implementations unless I have a legitimate reason not to - if for no other reason than the quality level of support I can get.

joseph.ferris