views:

2000

answers:

8

my team is starting a new project on asp.net mvc, and we are wondering what technology for data access to use, how do you think which one is the best, who has the best performance ? which one is easier to use and to maintain ?

+1  A: 

My preference is LLBLGenPro - a really great ORM that just works like you'd expect. Its not based on configuration like entity framework or nhibernate, it generates your DAL based on your db (with much flexibility through their tools).

http://www.llblgen.com/defaultgeneric.aspx

jayrdub
+1  A: 

LINQ2SQL is probobly easiest to use. Entity Framework provides great extensability and the future release will contain alot of improvements.

One key rule for performance: write code that is easy to maintain, read and distribute; if it's to slow - optimize!

I think that the difference in performance between the ORMs today is bareley noticable, so you should pick the one that feels most comfortable and efficent to work with.

Mickel
+1  A: 

Entity Framework has better mapping of relationships than linq2sql (for example, it has multiple-multiple relationships).

I haven't used the other two, but I used Hibernate in Java and it was pretty straightforward to use.

Carles
+1  A: 

This blog post compares various data technologies for .NET in various aspects (performance, maintainability, testability etc.). Might be of some help to your decision making process.

Buu Nguyen
That blog post is a little dated. NHibernate now has Linq support. The blog post doesn't mention Fluent NHibernate. It doesn't look at LLBLGen or Subsonic, which both have decent mind share in the real world. I have other minor nits, but in general, I disagree with the overly high scores that Entity Framework ended up with, especially pre-.NET 4.0.
Michael Maddox
Michael, SUbSonic isn't decent at all. I really don't understand why people even try it. Just its 300 Kb assembly to e.g. 4 Mb @ OpenAccess - it must be clear it is just a tiny toy. And forget about LINQ there - I bet its LINQ support would never be even comparable to others.
Alex Yakunin
Sorry, "SubSonic" and "Just its" => "Compare its" ;)
Alex Yakunin
A: 

I face same dilemma. LINQ2SQL will give you more flexibility and immediate control over data access, however Entity Framework is the "enterprise" solution. I am currently trying this - SubSonic and look very promising.

Balchev
+23  A: 

If .NET 4.0, choose between NHibernate or Entity Framework. NHibernate is more extensible and generally more feature rich. Entity Framework works better for firms that would rather have what Microsoft provides. They are both valid options and no one has yet published an objective significant blow by blow comparison. This is one of the better non-objective comparisons:

http://ayende.com/blog/archive/2010/01/05/nhibernate-vs.-entity-framework-4.0.aspx

If .NET 3.5 or earlier, choose NHibernate.

http://stackoverflow.com/questions/1238972/choosing-database-and-orm-for-a-net-project

http://stackoverflow.com/questions/567304/which-orm-tool-should-i-use-for-net-development

http://stackoverflow.com/questions/557948/easiest-to-learn-and-use-net-orm-framework

http://stackoverflow.com/questions/550929/some-suggestions-on-which-net-orm-to-look-at-learning

http://stackoverflow.com/questions/474973/best-orm-tool

http://stackoverflow.com/questions/380620/what-object-mapper-solution-would-you-recommend-for-net

http://stackoverflow.com/questions/249550/what-orm-frameworks-for-net-do-you-like-best

http://stackoverflow.com/questions/206197/best-free-orm-tools-to-use-with-net-2-0-3-5

http://stackoverflow.com/questions/132676/which-orm-for-net-would-you-recommend

After September 04, 2009:

http://stackoverflow.com/questions/1381916/or-mapping-tool

http://stackoverflow.com/questions/1443846/o-rm-choice-not-reliant-on-linq

http://stackoverflow.com/questions/1469761/nhibernate-vs-entity-framework-vs-something-better

http://stackoverflow.com/questions/1470787/how-to-choose-an-object-relational-mapping-for-net

That said, things change. Now that NHibernate supports Linq, I think NHibernate is the clear choice in the large majority of situations. For a longer and fairly up to date analysis, feel free to read this:

.NET and ORM - Decisions, decisions

Michael Maddox
A: 

To compare ORMs - take a look on http://ormbattle.net/

Yury Skaletskiy
That site already has a very bad reputation. :(
Michael Maddox
Agreed, you have to look at which ORM company supports this website!
Codezy
Guys, visit FAQ and Blog @ ORMBattle, they explain a lot.Michael, this site has bad reputation _for you_ - I suspect because SubSonic you promote here shows its true face there.
Alex Yakunin
A: 

Take a look at Worm - free, open source object mapper. Besides relational mapping it supports hierarchical mapping (XPath mapping for xml data storage).

Alexey Shirshov