Personally, I prefer to configure NHibernate in code by using a fluent API. It makes the configuration very readable and self-expressing. Also, when defining the configuration, the individual settings are much more discoverable to the developer executing this task.
NHibernate contains a new fluent API for configuration. This API is defined in the
Loquacious namespace. All aspects of the configuration can be defined by using this API. The configuration in the preceding sample was already very readable, but the usage of the new fluent API will make it even more understandable.