Re: [picocontainer-dev] [6.2/6.0] Re: [picocontainer-dev] Bug or feature?

Konstantin Priblouda <kpriblouda-/[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
--- Paul Hammant <[email protected]> wrote:

>        T getComponentInstance(PicoContainer
> container) throws  
> PicoCompositionException;
> 
> .... only requires a container instance to be passed
> in at  
> getComponent time.  Which ref is passed in ?  parent
> or child ?

That's differs in current trunk code base...

When you use container.getComponent(key) it looks up
the adapter and then passes  itself ( leaf )

When you use containt.getInstance(CA) it finds
container hosting this CA and passes it.

Weird what? 


> It might be nice for the one that the
> getComponent(..) is being  
> invoked on to exclusively be passed around for all
> resolves - though  
> that requires a lot of thought before we change
> things.


I would prefer that CA is always resolved against own
container... This can be achieved by:
 - keeping reference to container in CA ( say, while
registering ) 

 - walking down the root  everywhere where user can
pass container to ca. 

Anyay, do users have any need to use CA besides 
registering components in a weird way? 


BTW, another question arises during refactoring:

is it wise to cache result of adapter resolution in
parameters? 

regards,

regards,

----[ Konstantin Pribluda http://www.pribluda.de ]----------------
JTec quality components: http://www.pribluda.de/projects/


      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs

---------------------------------------------------------------------
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.