InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

NHibernate 2.0 Offers Many New Features

Posted by Hartmut Wilms on Apr 03, 2008

Sections
Architecture & Design,
Development,
Operations & Infrastructure
Topics
.NET ,
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

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?