RE: [picocontainer-dev] Ambiguity resolution?

Jörg Schaible <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Konstantin Priblouda wrote:
> --- Jörg Schaible <[email protected]> wrote:
[snip]
>> ??? I don't find that test in trunk, but this must
>> be resolved.
> 
> This is a test FOR trunk (kind of additional test to
> demonstrate unclear behavour) - just copypaste it
> to DPCT

OK. Missed that.

>> It is common
>> practice to generate a child container with
>> "overlaoded" components. If you
>> want a collection of Integers this is something
>> completely different.
> 
> Yes, but in this case child integer is not masking
> parent - it got different key. So IMHO this shall
> produce ambiguity.

No. The parent is only requested if the child container cannot resolve the dep (note, this is different for a collection). In this case the child is requested for an arbitrary Integer instance ... and it can provide one. So no ambiguity. The key is only considered if the type of two components *in the same* container match.

- Jörg

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.