InfoQ

News

NHibernate 2.0 Offers Many New Features

Posted by Hartmut Wilms on Apr 03, 2008 04:20 PM

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

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

Reply

Exclusive Content

Typemock: Past, Present and Future

Eli Lopian of Typemock answers a few questions on Typemock origins and where Typemock is headed.

Agile in Practice: What Is Actually Going On Out There?

Scott Ambler talks about actual data resulting from surveys made during 2006-2008, showing how Agile is perceived and implemented within organizations.

Building Smart Windows Applications

From QCon 2008, Daniel Moth presents on using Visual Studio 2008 and .NET 3.5 to create compelling rich Windows applications.

Joshua Kerievsky about Industrial XP

Joshua Kerievsky, founder of Industrial Logic, talks about Industrial Extreme Programming which extends XP by including practices dealing with management, customers and developers.

Jeff Barr Discusses Amazon Web Services

Amazon Web Services (AWS) Evangelist Jeff Barr discusses SimpleDB, S3, EC2, SQS, cloud computing, how different Amazon services interact, origins of AWS, AWS globalization and the March AWS outage.

More Than Just Spin (Up) : Virtualization for the Enterprise and SaaS

Cloud services have helped bring virtualization to the forefront. Its full power however, also includes other benefits such as high availability, disaster recovery, and rapid provisioning.

Ruby Beyond Rails

John Lam talks about his path to dynamic languages, some of the problems of making IronRuby run fast, and how the DLR helps with implementing languages.

VMware Infrastructure 3 Book Excerpt and Author Interview

VMware Infrastructure 3: Advanced Technical Design Guide and Advanced Operations Guide provides a wealth of practical insights into setting up virtualization in todays corporate environments.