Category Archives: Programming

Hug a developer today

How much has change NHibernate since 1.2.1 till 2.0 GA ?

Patrick Smacchia sent me this link where NHibernate 1.2.1 GA and 2.0 GA are analyzed with NDepend.

I want to you appreciate the analysis made with this tool, to see how much of details it offers to build comparatives between both releases. What I consider the most important is the analysis of the changes made. You will see in the picture with the blue zones, all the refactored parts, and you can arrive to conclusions :)

NHibernate 2.0: Changes Overview

yaml, an alternative for XML

yaml is an serialization data language, an alternative to the markup language of XML. And I think is pretty cool their use it, because really is more readable than XML. It’s focus on the simplicity. Let’s go to an example took from the reality, this is how an NHibernate mapping file should look with the yaml format:

If you use NHibernate, you know, this is too much easy to read. As you see the delimitation is made for the indentation, if you know something about languages like Python this is very familiar. Of course, this is not provided, but who knows, maybe someone want to donate some hours to the OSS and make it ;)

Maybe a notorious disadvantage is that yaml don’t have schema. And you can guess the missing features because of that, the most important is the yaml-validation.

In the .Net world is not so popular, but in languages like Python, Php, Perl, C++ is well used. In the brand new baby of Google: Google App Engine, which the main language of the core is Python (actually right now is the only one supported) uses yaml of data definition.

Fluent Interfaces on NHibernate

Ben Scheirman proposed at this entry a interesting theme for apply to NHibernate:Fluent Interfaces.

The main idea it’s create the NHibernate mappgins programmatically instead of using XML, but not only that, but also using fluent interfaces too.

There are many ways to create fluent interfaces for specific domain, and exists several advantages of this approach at the time to consume the code, but above all to read the code. The code must be very easy to read and this make it interesting.

Write fluent interfaces it’s a more complicated  and required practice.

Resources: