public class AddressValidationDef: ValidationDef<Address>
Define(x => x.Country)
Define(x => x.Zip)
The thread about the API still open so, if you have some advise you can leave your opinion here or there.
One peculiar characteristic of NHibernate.Validator.Cfg.Loquacious is that was implemented avoiding XML generation; this mean that we are using NHV’s APIs to create all metadata needed by the ValidatorEngine.
I start this work only for fun and now I can make public my considerations about fluent-configuration.
“people use XML because they can’t use something else”: FALSE. I use XML because it is the more flexible and less intrusive than other “conf-ways”. A modern developer can’t avoid the knowledge of XML.
“fluent-configuration support Refactoring when XML don’t”: FALSE. Refactoring is not a matter of the language you are using to configure; the Refactoring is an IDE functionality (Eclipse users know this fact). The problem in .NET world is that, for us, is more easy the implementation of “fluent-configuration” than a VisualStudio/Resharper plug-in (check this or this for example).
“fluent-configuration is more readable”: Well… let me say that some fluent-configuration APIs are absolutely not more readable than XML.
“implements fluent-configuration is a big challenge”: basing the opinion in this experience I can say that is FALSE; it was a work of few hours (around a 5% or 6% than XML configuration).
That said, fluent-configuration is a useful tool but it is absolutely not indispensable to evaluate a framework usability.