27

We are getting ready to begin redevelopment of a large aging internal enterprise application. We have decided to use ASP.NET MVC, but under consideration is which Object Relational Mapping (ORM) to choose. There are of course a multitude of open source and paid ORM implementations available. However, NHibernate seems to hold the largest mindshare, while the Entity Framework is the new hotness from Microsoft.

While we are doing research and toying around with both we wanted to put it to the community as to which ORM (NHibernate, Entity Framework, or otherwise) they prefer and why.

Somewhat similar Stackoverflow Questions

Additional .NET ORM Reading

4
  • No offense, but it does seem this has been asked before: stackoverflow.com/search?q=.net+orm . stackoverflow.com/questions/380620/… was closed as a duplicate. Commented Jun 16, 2009 at 22:48
  • Wow, I don't know how I didn't find that question when I was searching. Both Google and the SO search failed me. No offense taken on the closing as I wouldn't have asked the question otherwise. :) Commented Jun 16, 2009 at 22:51
  • Since I agree that this should probably be closed is it better to delete the question or vote that it be closed? Commented Jun 16, 2009 at 22:56
  • IainMH's comment below is of sufficient value that the question shouldn't be deleted. Commented Jun 16, 2009 at 23:27

3 Answers 3

13

You should have a look at Sharp Architecture an ASP.NET MVC application framework which uses NHibernate.

I've used a few O/RMs in the past couple of years and there's no way would chose anything other than NHibernate.

  1. It's the most mature.
  2. It's got a huge set of features.
  3. It's got a good community behind it.
  4. It's got some fantastic ancillary projects such as Fluent NHibernate.

I don't know what more information people will be able to give you over and above in the questions that you have linked to.

Sign up to request clarification or add additional context in comments.

1 Comment

@Storm Thanks, looks like link rot. I have updated the url to point to the github repository.
2

Crazy talk answer: none.

This is not to say ORMs are not awesome pieces of technology when used right. But in 2011, they are quickly becoming the universal hammer where not all problems are nails. And there is so much going on in the modern ORMs that, especially for people not well versed in them, they can confuse things more than help things. Or, sometimes things are simple enough that straight SQL is a better alternative. No matter how good the ORM is, the abstraction will leak at some point.

The other side of things to look at is the whole NoSQL movement. The technology is still a bit new, but for new work it is a data access strategy one must consider as it takes so much cruft out of building your application.

1 Comment

The OP clearly stated that they were redesigning their enterprise applications, not starting to learn something. And when you want persistence, most of the times ORM is the easiest solution.
0

Short answer: use both (i do really use both)...

With ORM there are multiple possibilities, all depends what you want.

As a real ORM mapper I strongly recomment NHibernate and Fluent NH mappings. You need a lot of research to put together a nice architecture, but then nothing stands in your way. With minimal compromises you get real flexibility.

EF6x (core is not prod.-ready IMHO) is called an ORM, but what it generates is more closer to a DAL. There are some thing's you can't do effectively with EF6. Still, this is my favorite tool for a read-model, while I do combine it with NHibernate (where NH I use for a DDD/write model).

Now to performance - its always pro and cons. If you deep deeper into ORM architecture (see my article: avoid ORM bad habits) then you will find intuitively the ways to make it faster. Here's my another article on how to make EF6x 5x faster (at least for read situations): EF6.x 5x faster

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.