Tuesday, February 02, 2010

More Fun with Fluent NHibernate Automapping

NHibernate is a flexible and adaptable framework; and when you understand the way it works and how to utilize its strengths, it can bring significant benefits to your projects. But being flexible and adaptable comes at a cost. Developers who are new to this ORM framework often claim that NHibernate has a steep learning curve, and they are correct –mastering NHibernate does require significant study.

Like any other tool, you need to get the facts and carefully consider where you'll invest your limited time. One of my personal 2010 goals is to become completely comfortable with both NHibernate and Fluent.NHibernate. I made this decision after a great deal of thought and study. My conclusions were that NHibernate is still years ahead of competing technologies and is likely to remain so for the foreseeable future for .NET developers. I could have decided to invest my time studying ASP.NET MVC, but I decided that NHibernate is much more important for me.

Fortunately, there are some new approaches including Fluent NHibernate, which is now in its 1.0 RTM iteration, that can make basic NHibernate projects very easy to implement and which can give you a taste of how powerful NHibernate really is, but with only a very modest investment of effort. That’s the purpose of this article.

To begin with, this tutorial focuses on the “Top Down” development paradigm. As Microsoft .NET Framework developers, most of what we have learned and most of the tools we have been given (LINQ To SQL, Entity Framework, DataSets, and so on) have been what we call “Data-centric” – meaning that you start with the database schema, and build everything around that. This is a methodology that can quickly create difficulties when one wants to approach business problem solutions in a true OOP – object oriented manner. With NHibernate and Fluent NHibernate, you do not need “Visual Designers” because you can start with your domain model and not have to worry about what the database will look like. And, you don't need to stab your fingers anymore with XML Mapping files!

Read more: eggcafe

Posted via email from jasper22's posterous