Yes, Darius... but every time I write a post talking about the usage of
interfaces for entities (including only interfaces without classes or even
only mappings without classes nor interfaces) somebody point me to Anemic
Domain Model anti-pattern.
When somebody point me to an anti-pattern for sure I read which is the full
description of the anti-pattern and, over all, I pay attention to the
possible problems... after that I do what I need (pattern or anti-pattern).

2009/7/16 Darius Damalakas <[email protected]>

>
> I've found some nice documentation on this in Hibernate documentation.
>
>
> http://docs.jboss.org/hibernate/stable/core/reference/en/html/performance.html#performance-fetching-proxies
>
>
> What is interesting is that everything boils down to the fact that
> "These problems are all due to fundamental limitations in Java's
> single inheritance model".   I guess the same applies to C#, since it
> also supports only single inheritance.
>
> They also propose a solution -  instruct that proxies must be
> constructed for interfaces, not for implementations. They give this
> example:
>
> <class name="CatImpl" proxy="Cat">
>    ......
>    <subclass name="DomesticCatImpl" proxy="DomesticCat">
>        .....
>    </subclass>
> </class>
>
> On 16 Lie, 16:00, Darius Damalakas <[email protected]> wrote:
> > Hi,
> >
> > I've just upgraded to NH 2.1.x branch, and i get these errors:
> >
> > WARN  NHibernate.Engine.StatefulPersistenceContext.ProxyWarnLog
> > [(null)] - Narrowing proxy to RisingStar.BLL.Model.Contact - this
> > operation breaks ==
> >
> > I checked the code, and it says this:
> > "If the existing proxy is insufficiently "narrow" (derived),
> > instantiate a new proxy and overwrite the registration of the old one.
> > This breaks == and occurs only for "class" proxies rather than
> > interface" proxies" (StatefulPersistenceContext.cs: 680)
> >
> > What does it mean "inssuficiently narrow ? Could someone provide an
> > example, when a proxy is not sufficiently narrow?
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to