Azure DevOps, Scrum, & .NET Software Leadership and Consulting Services

Introducing Slide Speaker: Videos with Voice-over from your PowerPoint and Google Slides Presentations

NHibernate, Part 2 of xxx: Is it worth it?


Ok.  So.  I’ve been playing with the object relational mapping framework called NHibernate for a while now. 


I’m pretty conflicted about it.  It’s definitely cool and it has a lot of great features (most of them I’m probably not even aware of yet). 


If you’re doing .NET development, it’s pretty much a given that you know ADO.NET and probably 99.9% of .NET shops use ADO.NET.  Even if you’re not a database expert, doing basic CRUD operation with ADO.NET is pretty easy and even if you don’t know how to do it, there are 4000 books out there that’ll teach it to you it in about 2 pages.        


And then there’s NHibernate.  If your architecture goes heavy on business entities and light on DataSets, NHibernate solves your sticky data access problems.  You set up your O/R xml mappings and you’re pretty much good to go.  Where it gets sticky is when you have to start doing custom queries against the db.  Example, give me all the users that aren’t associated to the a customer who have been created in the last year.  NHibernate will do that for you.  The problem is that you’ve got to learn the NHibernate syntax and that syntax is definitely different.  If you know database programming, you’re going to get pretty frustrated trying to figure this out the first time you want to do it.


And that’s where I start to see a big downside to NHibernate.  It’s just another technology for someone to learn in order to get their work done. 


From a nerd’s perspective:  It’s cool.  It’s nifty.  It’s a new way to do stuff in .NET.  Hell…it might even let you write more elegant code.


From a company’s perspective: It’s just more stuff to worry about supporting.  You can’t hire your average .NET programmer off the street because he/she very likely has never HEARD of NHibernate let alone actually worked with it enough to maintain a company’s code base. 


The jury’s still out.  [Update 12/10/2005: The jury came back in early October.  Here’s the update.]


-Ben


 FYI, other posts on NHibernate are available here.

SUBSCRIBE TO THE BLOG


2 responses to “NHibernate, Part 2 of xxx: Is it worth it?”

  1. Mark Avatar

    I use Hibernate for my own web application in Java and it worked great. I just started my first job ever as a .NET developer LAST WEEK and installed NHibernate today. It went right in with no problems, all the code is now very clean and it handles complex objects well. Also, I taught a VERY Junior developer (7 months total experience) how to use NHibernate while I was learning to use it in .NET. It’s THAT simple. I cannot buy the argument that there is an issue with any developer who can’t pick up NHibernate in just a couple of hours. I’m not a genius.

  2. sriharsha Avatar
    sriharsha

    Nhibernate in throwing lot of exceptions like no persister found etc… not exactly telling what is the problem. And yes, implementing is risk.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.