Re: [picocontainer-dev] A way forward for annotations in Pico codebase

Jörg Schaible <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Paul Hammant wrote:

> Erik,
> 
> On May 1, 2007, at 9:43 AM, Putrycz, Erik wrote:
> 
>> I totally agree about the two sides.
>> Concerning the generics, I don't mind working against pico 2 svn if
>> that
>> can provide a way to support the generics.
>>
>> As a note,
>>    pico.registerComponentInstance(PicoContainer.class, pico);
>>
>> doesn't totally work cf http://jira.codehaus.org/browse/PICO-292. I
>> had
>> solved this problem but Joerg said it was this was not a valid use
>> case
>> (and causes security problems?) so I never bothered sending a patch. I
>> don't mind looking at it again if that could go somewhere.
>>
> 
> Of course.  There's not an easy work around. Wrapping in
> ImmutablePicoContainer on registration would work if the start()/stop
> () methods were silent. At least before Pico2 where PicoContainer is
> no longer Startable - MutablePicoContainer is instead.
> 
>> It also seems to me that the current code in the svn works pretty much
>> the way you are suggesting (thanks to Mauri's nice refactoring). The
>> annotation @Inject is processed by the InjectingComponentAdapter.
>> Basically this could be used on its own with the Inject class in a
>> DefaultPicoContainer.
>>
>> The bug you are talking in injectDependencies, is it about circular
>> dependencies? If yes, I'm not sure how to deal with it. To detect
>> them,
>> it would be necessary to know the whole object graph in this method?
>>
>> I know that other containers such as hivemind do allow circular
>> dependencies and do proxy everything.
>>
> 
> Spring too I think.  Amateurs! ;-)
> 
> We're never going to allow circular references.

Geez, Paul, we have this :)

IIRC you can do so, if the two types are interfaces with the
ImplementationHidingCA (isn't that one of yours? Hehehe) and for real
classes you can use the HotSwappingCA ...

> I think what I was trying to say that its possible for
> AnnotationInjectingComponentAdapter (please rename from too generic
> InjectingCA) to work the way the other ones do.  Playing with the
> design allows for more complex directive graphs.

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