views:

134

answers:

3

I've seen some jobs that require nhibernate knowledge, as well as numerous questions on stack. I found another question that pointed me to Summer Of NHibernate and I am watching the videos now. However it has no introduction explaining why NHibernate was created and what problem is solves. By looking on wikipedia, I can see vaguely what it does, but to me it looks like .NET already has the entity framework which seems to do the same thing.

Can anyone clarify why nhibernate exists?

+2  A: 

NHibernate has it roots in the Java Hibernate framework. According to Wikipedia NHibernate was first released in 2005, several years before Entity Framework which was released in 2008.

From what I have heard NHibernate is the more mature and flexible of those two, but I have not used it myself. Entity Framework can be seen upon as Microsoft's (yet unsuccessfull) attempt to crush NHibernate.

Anders Abel
Thanks, that makes what I am watching much clearer now.
SLC
+1  A: 

NHibernate shields you from having to deal with database interaction yourself, and handles database-specific details for you. This results in your being able to spend less time writing infrastructure code, and allows more focus on the interesting parts of your project.

Grant Palin
+1  A: 

It solves several problems related to the object relational impedance mismatch, provides an implementation of a unit of work, allows a measure of database independence , and facilitates domain driven design by facilitating persistence ignorance and providing the ability to generate your db schema as the domain evolves.

So it is a beast of a program in scope and breadth, and requires some knowledge of the buzzwords above! It actually does a bit more than that, which is why Summer of NHib is a 13 some odd part series, much recommended to go thru. The book NHib in Action is also very good.

Most important, give yourself a break and allow yourself up to six weeks to take it all in.

HTH,
Berryl

Berryl