First I want to say that I love this rewrite. Convention over
configuration always wins in my opinion, as long as the conventions
follow sensible defaults and best practices, which seems to be the
case.
Second I'd like to agree with Nick in that FNH serves its users best
when it mirrors how the programmer thinks when he designs his objects
and not how he would think if he was going to map the same object with
HBM XML. Renaming "index" to "key" and "element" to "value" makes a
lot of sense in that case. The same goes with renaming "key" to
"ForeignKey".
I haven't poked around with the code yet, but I have one question;
since the new dictionary mapping infers a lot more than previously,
how does it now handle custom collection implementations? Is that left
up to NHibernate to eventually blow up on if not configured right or
will FNH warn about it? And how would you set up a custom collection
implementation -- the same way as with HasMany?
-Asbjørn
On 4 Aug, 17:05, Nick Webb <
nwe...@gmail.com> wrote:
> Fluent NHibernate is, after all, a big facade of NHibernate's xml mappings,
> no? Being a facade, I would not concern myself with how literal the fluent
> methods resemble the hbm context, as you said it yourself: you aren't
> necessarily looking to recreate the xml in c#. Instead, I'd follow a
> philosophy of how the methods best represent how the object property is
> being mapped. That's my opinion, anyway.
>
> So you're example of Index -> Key and Element -> Value seems very
> appropriate, especially for those not interested in learning how to rebuild
> an hbm map the 'fluent' way.
>
> To continue this approach:
> Index = Key
> Element = Value
> Key = ForeignKey
>
> My $0.02.
> - nick
>
> >
fluent-nhibern...@googlegroups.com<fluent-nhibernate%2Bunsubscr
i...@googlegroups.com>
> > .
> >
fluent-nhibern...@googlegroups.com<fluent-nhibernate%2Bunsubscr
i...@googlegroups.com>
> > .