Love and Fluent NHibernate
I’ve been playing with this Fluent NHibernate a bit lately. This is a 3rd party open source library for configuring NHibernate, Fluent NHibernate is a new way tell NHibernate how to map tables and columns to classes and properties. It does this with a .Net based DSL.
Like everyone else I’ve had my share of frustrations configuring NHibernate, miss setting one hbm file to “Compiled Reference” and all sorts of things will start to go wrong. My other gripe has been that hbms were not refactoring friendly.
Fluent NHibernate has changed almost all of that. It is refactor friendly, no xml files to maintain, and I swear it is less typing to create. It is a wonderful addition to the NHibernate family.
Here is the really funny part. Fluent NHibernate is a very new project. They are still developing features, still working out some bugs in the code. Fellow Elegant Coder Tony Rasa put in a bug report…it was fixed in the morning. I heard from Jeremy Miller file a bug report…they had it fixed in a couple of hours. Now that is the definition of an active project.
I should also note: keep an eye on nhforge.org. The forge is the place where you can find out what is happening with NHibernate. Subscribe to the blog feed. Both nhForge and Fluent NHibernate are using wiki stile management, so content can
change improve quickly.
As for getting started, I would be foolish to put too much code on this blog post. The samples on the Fluent Nhibernate site are quite good.