Get Rid of Your XML – Go Fluent NHibernate

· August 31, 2009

After a brief experience with NHibernate, I quickly realized that managing XML files for mapping instructions can lead to several issues. XML files lack compile-time checking and can create discrepancies between code and configuration.

The solution? Fluent NHibernate. This library allows you to define mappings in code using a fluent interface, eliminating the need for XML configuration.

I recently explored their starter example and was impressed. The approach is intuitive and offers features that feel almost magical, such as auto-mapping. It aligns well with the idea of “letting the storage issues be a consequence of the domain model”.

Twitter, Facebook