Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework 4.1 VS Nhibernate, for noob in ORM

I am in process of evaluating ORM first time. Please suggest which one i should choose for my next project.

I wrote couple of sample code with EF 4.1 code first. Before start same exercise with Nhibernate, I want to know if somebody have already experience with both in production application.

My evaluating criteria

  1. Speed of database access
  2. Learning curve (because I am new to ORM)
  3. Community support
  4. Tutorial/Books availability
  5. Anything else which I should consider (Because I am noob to ORM)

I wish if people who have experience with both the ORM in production level app answer my question.

Thanks in advance!!!

I am aware that this question may be a little bit dangerous to ask ;)

like image 340
Mahesh Avatar asked Dec 28 '22 08:12

Mahesh


1 Answers

Having used EF 4.1 and Castle ActiveRecord (based off NHibernate), I would rate them as follows:

Speed of DB access - NHibernate for anything remotely complex, otherwise about the same. The problem with EF is that it creates such convoluted SQL that it's difficult to know how to optimise it or if it's even possible to do so.

Learning curve - I personally found EF easier to get started with, but others may feel differently, and both certainly have a learning curve.

Community support - Depends on what you mean by 'support'. You'll find lots of info on the web (and this site) for both. NHibernate is open source, while EF is controlled by MS.

Tutorials/Books - I believe there are more 'official' resources available for EF at this time, but searching on forums will likely get you what you can't find in books.

Anthing else - Realize that the purpose of ORM's is to simplify the data access layer for the developer. However, both of these ORM's (and pretty much every other heavyweight ORM) expect you to use certain coding patterns for this simplification to be realized. While coding pattern enforcement isn't a Bad Thing (some would argue that it's a must), it's something you certainly need to prepare for before choosing one.

like image 68
PinnyM Avatar answered Jan 08 '23 05:01

PinnyM