ASP.NET MVC and ORM Selection ASP.NET MVC and ORM Selection asp.net asp.net

ASP.NET MVC and ORM Selection


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.


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.


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