Welcome to AspAdvice Sign in | Join | Help


Some day I will know everything I hope that day never comes




My Thoughts on NHibernate

I have been using NHibernate for about a month. During this one month I had some good times and some bad times using NHibernate. Here are some of my thoughts regarding NHibernate.


1) You are free from writing stored procedures for every little fetch or CRUD operation. This saves a lot of code.

2)  NHibernate allows you to focus on the domain model of the application.

3) NHibernate allows you to write better tests which can be rollback using ITransaction interface.


1) Very steep learning curve.

2) If you miss a small setting your application will fail as a whole.

3) Complex configuration settings .

4) Lack of support from the NHibernate community. I have posted various questions on the NHibernate forums unfortunately none of them were ever answered.

With DLINQ comming out in few months I see a dark future for NHibernate. All in all NHibernate is a great piece of software build by great developers.


Published Thursday, October 4, 2007 12:24 PM by azamsharp

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS


# re: My Thoughts on NHibernate @ Thursday, October 4, 2007 1:32 PM

I agree with your points, especially the part of the application failing with one small change... but I don't think that these other points are so bad. The learning curve is steep, but once you get it, you don't need to even worry about it. The complex configuration gives you the flexibility to control how NHibernate behaves, but to get started you only need to specify 4 or 5 settings. Lack of support is something that I haven't seen. I have gotten replies from the team and helped identify bugs. The forums are pretty active and generally help solve problems. My best resource are the NHibernate contacts I have met during my professional career, and usually just talking to someone about issues helps out a lot. The last point I would like to make is that I see a bright future for NHibernate. The advent of DLINQ is nice and all, but it only solves part of the problem: Querying. You still have to build your tables, you still have to map the results to objects, and you still have all of the concerns that any complex OO application will have. If you were referring to the Entity Framework, then I see 2 different groups of people adopting it. There are the hard core domain model programmers that have adopted NHibernate and will continue to use NHibernate... then there are the people who are fairly new to the concept and will just pick up EF because that's what Microsoft is shipping. Depending on what direction the EF project takes, I can see many people jumping ship once they see the differences. EF is/will be in version 1, so it's going to have some issues, but functionality and with usability. If you want my advice, keep with NHibernate. You'll keep learning and suddenly the ORM portion is a no-brainer, leaving you to focus on business logic (read: business value) first.

Ben Scheirman

# re: My Thoughts on NHibernate @ Thursday, October 4, 2007 1:49 PM

I agree with most of the points that you mentioned. The real fun when using NHibernate is the focus on the domain layer. I don't have to think about the data access or other stuff. I just have to think about the business logic which is the brain of application.


# re: My Thoughts on NHibernate @ Thursday, October 4, 2007 1:51 PM

One other PRO I like to add is NHibernate works with wide variety of database while LINQ,DLINQ as of now works only with SQL SERVER.


# re: My Thoughts on NHibernate @ Friday, October 5, 2007 2:21 AM

If you really want to focus on your domain layer have a look at Persistor.NET (www.persistor.net). There is only one model - your domain model! The database model is derived automatically. No mapping - no configuration at all. I am a developer of Persistor.NET. Hans-Peter


# You’re Not Your Data Access @ Thursday, June 11, 2009 11:51 PM

Seems I touched off a bit of a “swirl” with a comment I made on my last blog post: I think, in general

Rob Conery

Leave a Comment

Enter the code you see below