views:

185

answers:

4

Castle Active Record? Plain NHibernate? Subsonic? Entity? Something like Nettiers?

I'd like to use one, but I don't know enough to decide. Nhibernate seems over kill and complex, but widely used. Subsonic seems neat and easy. But is it stable? I have CodeSmith, and I was pointed to Nettiers, which seems neat as well, but complex too. How do others evaluate and decide what to use? Do you make small simple projects with each to see the features? Eeeny, Meenie, Miney, Moe?

+2  A: 

I like NHibernate. It's actually not that complicated, it's surprisingly flexible and it doesn't pollute your object model with attributes and other funky stuff that shouldn't be there.

I find that the active record pattern doesn't fit that well into a statically typed language like C# as much as the domain pattern does, as it can make mocking more complicated.

jonnii
But on the other hand, given the OP is new to ORM's in general, I would guess that his first forays into the space will look like ActiveRecord anyway. Its worth considering Castle.ActiveRecord simply because it offers a gentler introduction to nhibernate. Worked well for me!
Paul Batum
+1  A: 

I too prefer NHibernate and agree that if you put a little bit of effort into learning it you'll realise that it isn't as complicated as it first appears. You can go a long way without having to know all of its features.

However, you should always pick the right tool for the job at hand. If you're building an app that has something approaching a true domain model then NHibernate would IMO be the automatic choice. The others you mention are not true object relational mappers but code generators. That in itself is not necessarily a bad thing but you must evaluate when one approach is more appropriate than the other

SteveB
I guess I am looking for a code generator then. Are there any decent tools for making mapping with nhibernate easier?
nportelli
A: 

Since the question is "how do I pick" and not "what should I pick"...:

I'd pick the one that seems easiest to use first. Then I'd research a bit on google to see if it seems stable. Then I'd stress-test it myself, with some multithreaded goodness and a domain structure that has different types of relations and inheritance.

You can also get inspired by http://polepos.sourceforge.net/ it's a database performance benchmark but mostly for the java frameworks. If you're up for it you can adapt the source code to .net, it's not horribly complex.

That said, my current favourites are ActiveRecord and LINQ.

Sebastian
A: 

I guess the best way to decide which one is to try and find a common problem that has solutions in the ORMs that you're evaluating. You'll get ideas as to the programming paradigm, style, amount of code, complexity and that sort of thing

Conrad