> No. I'm not. Because in NH-Core we will maintain XML mappings.
This is the fundamental problem. As long as there is ONE TRUE SOURCE,
all the other sources will be secondary and there will be version
mismatches and maintenance will be cumbersome at best.
>I don't understand which is the logic. An assignment of a property is
> a "logic" ?
You're not just assigning properties. You have conditionals, defaults,
how settings are cascaded down from parent nodes, etc.
This is all logic, where 'logic' is "Stuff that I wouldn't automatically
get just by deriving from the Configuration class"
Worse yet, you simply copied and pasted it. This is a bad DRY violation
and harms the stability and maintainability of the project.
> If so, yes there is a lot of logic and is normal when you
> are reading infos from different sources.
You're not listening to me. The vast majority (I'd estimate 90% or more)
of the code is DUPLICATED, pure copy/paste. This is not different and
should be in a base class or a decorator of some type.
> In the half of 2007 Jim Bolla done a lot of work around
> binders (something like 21000 lines
> generated/changed) and maintain that work is not so easy.
It looks like he took the first step of decoupling it from the XML. It's
in a much better position to transition to a semantic model, but it's
still heavily XML-ish (i.e. the XSD.exe-generated Hbm* classes).
> If you want, now, you saw a way to do it. So far I can't saw a project
> bypassing XML or with the intention to bypass XML. What I'm seeing are
> XML generators.
The way you showed was to essentially copy/paste the logic in the XML
binders. This is not a good way of doing it and will cause lots of pain
and bugs later. DRY is a very important principle to follow.
> Sure. Let me see something doing it. After that we can talk about what
> is good to port and maintain in NH codebase.
I volunteered before, and I'm happy to still do it, but what I'm
proposing is taking all the logic that's currently in things like
RootClassBinder and moving it into a base class and have the XML/XSD
Classes be one form of DSL (Fluent NHibernate being another, and there
could be others -- Boo, etc) on equal footing with the rest of them.
-c