Discussion:
Circular reference and injection of the container
Jonathan Ariel
2008-10-30 23:07:35 UTC
Permalink
Hi,
I'm using the latest version of picocontainer and I have the following
situations that I need to solve.
1. A needs B and I want to inject also A in B. How can I achieve that? B
doesn't requires A in the constructor, I can have a setter.
2. I would like to inject the container to the component that I'm getting
from the container. Is it possible?

Thanks!

Jonathan
Paul Hammant
2008-10-30 23:38:08 UTC
Permalink
It's highly undesirable, but its possible.

See http://svn.codehaus.org/picocontainer/java/2.x/trunk/pico/container/src/test/org/picocontainer/behaviors/CircularTestCase.java


Regards,

- Paul
Post by Jonathan Ariel
Hi,
I'm using the latest version of picocontainer and I have the
following situations that I need to solve.
1. A needs B and I want to inject also A in B. How can I achieve
that? B doesn't requires A in the constructor, I can have a setter.
2. I would like to inject the container to the component that I'm
getting from the container. Is it possible?
Thanks!
Jonathan
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Loading...