NHibernate in Action cover
welcome to this free extract from
an online version of the Manning book.
to read more
or

Foreword

 

Somewhere in the middle of 2004, I decided that I needed to take a look at additional ways to deal with persistence, beyond store procedures and code generation using Code Smith. At the time, I was mystified by the all the noise around ORM, business objects, and domain-driven design. I had data sets and stored procedures, and I had code generation to make working with them a bit easier, and the world was good. But as I began to deal with more complex applications and attempted to learn from the collective knowledge in the community, I began to see the problems with this approach.

Eventually, I understood the significant problem with my previous method of working with data: I was building procedural applications, where the data was king and the application behavior was, at best, a distant second. This approach doesn’t scale well with the complexity of the applications we need to build. Indeed, this programmatic approach has been largely superseded by object-oriented approaches. I see no reason that this shouldn’t apply to dealing with data as well.

I can no longer recall what made me decide to focus on NHibernate—it was probably an enthusiastic blog post, come to think of it. But whatever the reason, I made that choice. Four years later, I have yet to regret this decision, and I am proud to state that exactly 100 percent of my projects since then have used NHibernate for persistence. That decision has paid off in many ways.