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
LINQ ,
nHibernate ,
ORM

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

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.