The State of Entity Framework and NHibernate

Some time ago, I compared NHibernate and Entity Framework. It was from a very technical point of view, and I think it is still up to date. Today, I want to talk about the current state of things, from a less technical stand.

First, let me just say the obvious: NHibernate originated and is driven by the community, while Entity Framework is a Microsoft product. This makes all the difference in the world.

Entity Framework has a roadmap, a plan and a permanent team focused on the product, while NHibernate has nothing like this. The NHibernate community consists of some very talented programmers who spend some of their free time working on NHibernate just for the fun of it. However, it is not their main occupation, and so many questions and community requests get unanswered, reported issues pile up, parts of the codebase are really not very good and there are several remarkable features missing – the NHibernate guys used to bash Entity Framework for not supporting enumerated types, but NHibernate, in 2013, still targets .NET 3.5, does not support left joins in LINQ queries, is scarcely documented and still requires the usage of an obscure collection library called Iesi.Collections. Of course, being a community thing, anyone can jump in and help with this, and in fact, there are lots of people contributing with pull requests, suggestions and bug reports. NHibernate’s problem, in my opinion, is lack of leadership. As far as I know, it is not known if the next version of NHibernate will be 3.4 or 4, and what will be there, except, of course, bug fixes, and even less what will NHibernate evolve to, when will it support .NET 4.5 constructs such as async, and so on. The NHibernate Development list is very quiet, and these questions, as well as lots of others, have had no response to this date.

While Entity Framework’s functionality is way behind NHibernate – and believe me, it really is – it is gaining ground. Entity Framework has a leader, a well known team which makes its discussions publicly available and takes suggestions from the community in the form of requests and even code patches, some of which have already been incorporated in the main product. The next major version, 6, was announced some time ago, public betas already exist – and, of course, anyone can get the current version from CodePlex – and it points to a direction. Granted, it is not going to address any of NHibernate’s stronger points, but instead it is moving with what appears to be the current trend, namely, asynchronicity, .NET 4.5 integration and conventions.

I don’t think NHibernate is dead yet, but some things really need to change to make it a modern competitor to other O/RMs, if there is interest in it. There are other things than just functionality.



  • Great observation, totally agree! The list of features itself shouldn't be the only driving factor when choosing which technology to use.

  • Don't call the race just yet... Check out Production Ready, Eleflex offers a full end-to-end, SOA solution, including a complete ORM engine that beats NHibernate and Entity Framework in performance benchmarks as well as provides dynamic service modification. Check it out!

  • Interesting point of view. You mean 'anyone can get the current version from Codeplex' right?

  • Stefan:
    Yes, of course its CodePlex, thanks! :-)

  • I have been using NH for over 4 years now and I have to say I totally agree with your leadership comment. The team used to have a strong leader namely Fabio Maulo but since he departed no-one has taken up the reins.

    NHibernate is a great tool and the main reason I used it is its ability to connect to a MySQL database (amongst others). However it appears that this no longer a problem for EF5 so I might be tempted to jump ship.

    I suppose the smart money is to jump over to EF as in its current state I can NHibernate becoming a secondhand citizen in the main ORM marketplace.

    Dam shame.

  • Plenty of EF questions go answered!

  • NB: I have no financial interest in Telerik.

    On the Java side of the fence (where I've lived for a long, long time), there's JPA (Hibernate, DataNucleus, OpenJPA & EclipseLink) and JDO (DataNucleus), and technically speaking, JDO is largely a functional superset of JPA. I'm biased (by being on the JDO expert group), but I can say that JDO is awesome. It's designed from the get-go to be datastore-agnostic (from RDBs to ODBs to NoSQL & beyond) without sacrificing the ability to use native queries & APIs, very transparent, supports fetch plans including depth and recursion, and is very mature (>14 years old as of this writing, and its predecessor, ODMG's Java Binding, dates back to the mid 1990s).

    Through a long & winding road, one of the original JDO implementations, JDOGenie, made its way to Telerik, where it's now called OpenAccess.

    Just as my humble opinion dictates that JDO is superior to JPA (and Hibernate & co.), I would say the same about Telerik OpenAccess to NHibernate.

    While I can't verify your points about NHibernate's leadership, I can say that Telerik has been the steward for OpenAccess for quite a few years now, and they are very much a first-class player in the .NET space, AFAICT.

    I'd love to see your informed & strictly technical comparison of Entity Framework v. OpenAccess.

  • Too much bias to be a serious work.

    Q: What do you know/mention about hibernate development process?
    A: Zero

    Q: What do you know/mention about corporations behind/supporting hibernate?
    A: Zero

    And the real question is:

    What do you know about ORM??? Next to zero...

  • pffff:
    Who said anything about Hibernate? This is about NHibernate...

Add a Comment

As it will appear on the website

Not displayed

Your website