views:

726

answers:

3

I need a .Net ORM, and I heard some good things about this. I've had NHibernate running in the past, but this seems to make a lot of things easier.

However, two things made me a little nervous.

  1. It uses NHibernate 1.2, which seems old
  2. It's still an RC with its last release 18 months ago

Is anyone using it, and do they recommend it for a production environment? Is it still under active development?

Specifically, is it worth it to use ActiveRecord over just plain 'ol NHibernate?

+1  A: 

It violates domain-driven design because it forces you to add attributes to your domain objects and use the active record pattern through them, which ideally should remain simple POCOs. The rise of domain-driven design over classic 3-tier design means that it may not be a good library to become familiar with over the long term (maybe go for nhibernate straight up). On the other hand, it's an excellent and robust library to use, and the project that I used it on was a success.

Mark Rogers
While you're right about attributes, you can still use AR in a DDD fashion... i.o.w - without the active record pattern.you do this via ActiveRecordMediator<T>
Ben Scheirman
That's true, but I read some blog about how it wasn't as simple. But maybe I'm behind the times
Mark Rogers
That was cold whoever voted down without a reason.
Mark Rogers
So what? Don't be dogmatic. And if you need POCO, you don't use Active Record _pattern_ anyway.
Krzysztof Koźmic
Right, I'm kind of pointing that out. Maybe I've misunderstood your complaint. Sometimes, but not always, it actually pays to be dogmatic because consistency helps with understanding the code, and logterm maintance.
Mark Rogers
and logterm maintance -> and long term maintenance
Mark Rogers
+5  A: 

Yes, it is worth using ActiveRecord over just plain NHibernate, as it greatly simplifies configuration.

Mitch Wheat
with FluentNHibernate this point is moot.
Ben Scheirman
Also NHibernate.Mapping.Attributes which was available way before fluent-nhibernate
Mauricio Scheffer
+2  A: 

They have nightly builds of Castle which is compiled agains NHibernate 2.0 or even 2.1 as of now I think. Few people uses the RC3, and I believe a GA-release is to be expected soon.

However, even though ActiveRecord greatly simplifies configuration, aswell as ease up the usage of NHibernate even when querying etc, I've experienced that most of the time I still fall back to using NHibernate-logic in code, therefor not taking advantage of the other aspects of ActiveRecord (especially when it comes to 2nd level cache etc which afaik ActiveRecord doesn't support). Even HQL etc requires using plain NHibernate-logic to be useful in my experience.

Therefor maybe it's worth using straight NHibernate and skipping the ActiveRecord part unless you're building a pretty simple app where performance-tuning really isn't an issue, since you have various other configuration-options to XML nowadays.

jishi