Entity Framework 4.1 VS Nhibernate, for noob in ORM

I am in the process of evaluating ORM for the first time. Indicate which one I should choose for my next project.

First I wrote a couple of example code with EF 4.1 code. Before starting with Nhibernate, I want to know if someone already has experience with a production application.

My assessment criteria

  • Database Access Speed
  • Learning Curve (because I'm new to ORM)
  • Community support
  • Tutorial / Book Availability
  • Anything else I should consider (because I'm noob for ORM)

I wish that people who have experience working with ORM in a production level application will answer my question.

Thanks in advance!

I know this question can be a little dangerous to ask;)

+4
source share
3 answers

If you are a noob for ORM and you only need the basic functions, you may find that the Entity Framework and Nhibernate are more deadly and should look at light weight like Massive:

https://github.com/robconery/massive

This speaks of the two main problems that you face with EF vs NH

  • EF is all that Microsoft supports, and so all of their tools use EF by default. Make beginner code easier with EF.
  • NHibernate is more mature and has more features (if you need one), it also has a good developer community and a lot of blog information.

I would choose Massive if you need a simple / fast, but unsupported, EF if you want to easily support MS but are somewhat limited or NHibernate if you have time to learn the correct ORM.

Hope this helps.

+3
source

Using EF 4.1 and Castle ActiveRecord (based on NHibernate), I would rate them as follows:

Database access speed - NHibernate for something remotely complex, otherwise it’s about the same. The problem with EF is that it creates such collapsed SQL that it is difficult to understand how to optimize it or if it is possible.

Learning Curve - I personally found EF easier to get started, but others may feel different, and both, of course, have a learning curve.

Community Support - Depends on what you mean by "support." You will find a lot of information on the Internet (and on this site) for both. NHibernate is open source and EF is managed by MS.

Textbooks / Books - I believe that there are more “official” resources available for EF at the moment, but a search on the forums is likely to give you something you can't find in books.

Something Else - Understand that the goal of ORM is to simplify the level of data access for a developer. However, both of these ORMs (and almost all other heavy ORMs) expect you to use certain coding patterns for this simplification to be implemented. While applying coding patterns is not Bad Thing (some claim to be required), this is something you definitely need to prepare before choosing it.

+6
source

Well, my personal experience with Nhibernate was the right choice, in a difficult situation I was given the best results of the time, and it was much easier to learn.

At first I found out about this, and then I tried the Entity Framework, and it became easier for me to learn nhibernate. Although at that moment I did not know anything about ORM.

Community support and tutorials and books, I can say that they are both good and have a lot of material to learn.

Now I can use both of them, but still love Nhibernate a lot more.

+1
source

Source: https://habr.com/ru/post/1390512/


All Articles