Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some suggestions on which .NET ORM to look at learning

I am a little ashamed to say that I have never used an ORM; as you may recall most of my career experience is hacking around with Classic ASP and the little .NET I do tends to be maintenance only.

For my own career as well as in preparation for a new project at work (done in .NET finally!) I'm looking at adding an ORM to my skillset - being the masochist I am I'm also going to look at TDD while I'm at it for this project.

Anyways, I am using .NET 3.5 for the project (or plan to, anyways) so I am trying to decide what ORM I want to choose; like I said I am not really familiar with them but I know generally what they are supposed to do and how they do it. My choices are basically down to NHibernate or LINQ/Entity Framework. I haven't used any, but I've seen some demos of LINQ2SQL and of NHibernate.

NHibernate seems like it's more robust overall (Linq2Sql isn't even a "true" ORM) as well as heavily used in the ALT.NET community, which I want to explore more. However, EF is Microsoft's offering and, as such, will be heavily used by the majority of development teams out there who just use whatever Microsoft comes out with and don't look at any alternatives.

I've heard both good and bad things about EF, but I want to pick something that will give me a good foundation as well as look good to other employers if/when I find a better job in a company with a real development team.

EDIT: I should add that, if it matters any in picking an ORM, the application will have to deal with an existing database.

EDIT (02/15/2009 6:48 PM): The only database it will use is SQL Server 2005 Standard, running on Windows Server 2003. Given that this is for a project for work, my goal is to pick something that won't take me a very long time to get up to speed with (as I'm going to need to be productive and "Learning a new tool" won't look good to managemetn) but something that will be better than rolling my own DAL. At the time I haven't decided if the application will be a smart client or an ASP.NET application, but one part of it is more than likely going to be done with ASP.NET MVC.

like image 434
Wayne Molina Avatar asked Feb 15 '09 14:02

Wayne Molina


2 Answers

I would recommend nhibernate - since it is open source and has a very active community help is easy to get. A great starting point is The NHibernate FAQ, it ranges from post for beginners to very advanced concepts. Hit the ground running by reading and following Prepare your system for NHibernate and Your first NHibernate based application.

All employers that I worked for used NHibernate for ORM in .NET and Hibernate for ORM in Java - so you should benefit greatly from learning NHibernate.

like image 102
Tobias Hertkorn Avatar answered Sep 28 '22 09:09

Tobias Hertkorn


SubSonic from Rob Connery is a "Swiss Army knife" ORM based on ActiveRecord. You can be productive with it in 30 minutes. Be warned, it is NOT at the level of NHibernate in terms configuration options, etc. It is hugely productive, and the code is very clean. We use it on most of our projects.

like image 20
David Robbins Avatar answered Sep 28 '22 08:09

David Robbins