InfoQ

News

NHibernate 2.0 Offers Many New Features

Posted by Hartmut Wilms on Apr 03, 2008

Community
.NET
Topics
Data Access
Tags
ORM ,
LINQ ,
nHibernate

NHibernate 2.0 Alpha has been released this week. The current 2.0 release is the first step to the feature set of Hibernate 3.2.6, many classes have been completely rewritten and lots of features have been added.

InfoQ has had a chance to talk to Karl Chu, the project lead, as well as Ayende and Fabio Maulo about the details on the 2.0 release. When asked about the most important changes in 2.0 Karl responds:

There a lot of changes from 1.2 to 2.0.  If I were only allowed to pick one or two, I think the new inheritance mapping strategies (i.e. and ) and the new events infrastructure have the most impact.  They add tremendous flexibility.

Ayende has posted an extensive list of all the changes and new features on his blog. He agrees with Karl on the importance of the new Events, Actions and Listeners feature and adds the "major improvements to the Criteria API", especially Multi Criteria, which allows to "perform multiple queries against the DB in a single DB round trip and enabling interesting scenarios with batching queries".

The Events, Actions and Listeners feature offers means "to interfere with the way NHibernate performs its actions", says Ayende. "This is useful in many scenarios where you want better control on what NHibernate is doing". According to Fabio Maulo "what you can do with writing or overriding NH default event is limited only by your imagination". NHibernate shows many ways of making use of the event feature, e.g. NHibernate.Validator uses event/listeners, the future NHibernate.Search and NHibernate.Shards uses events and NHibernate AddIns provide examples on how to use events to merge NHibernate with the EnterpriseLibrary Validation-Application-Block.

Concerning the "Alpha" status Ayende explains:

We call this alpha, but many of us are using this in production, so we are really certain in its stability. The reason that this is an alpha is that we have made a lot of changes in the last nine months (since the last release), and we want to get more real world experience before we ship this. Recent estimates are of about 100,000 lines of code has changed since the last release.

Although many features have been added, "most of the work happened in the core", says Ayende, "porting the Hibernate 3.2 features and changing large parts of NHibernate to match the existing Hibernate 3.2 code base". Fabio points out that "NHibernate 2.0.0 is only the first step to Hibernate 3.2.6" and that release 2.1.0 will finally close the gap.

On support for LINQ queries Karl Chu says: "I personally believe the success of NHibernate.Linq will play an important role in the continual success of NHibernate". Ayende elaborates on the Linq for NHibernate (NHibernate.Linq) sub-project:

Linq for NHibernate is an ongoing effort, right now we have a baseline functionality, working against NHibernate 2.0 Alpha 1.
We are working on getting the advanced scenarios working. Once we got that, we will merge Linq for NHibernate into the NHibernate project (probably as a contrib project for now) and release it with NHibernate.
Note that NHibernate will remain fully compatible with .NET 2.0, Linq for NHibernate will be an AddOn.

The roadmap for NHibernate 2.x "is to have all the features in Hibernate 3.2; we are not very far from that", claims Karl Chu.

Juli Lerman writes about NHibernate 2.0 Alpha and its relationship and positioning to Entity Framework pointing out that "EF still has a long way to go, so in the meantime nHibernate continues to get stronger and stronger".

 

No comments

Watch Thread Reply

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.