RE: [picocontainer-dev] Builder confusion and cycles in annotation

"Putrycz, Erik" <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Hi Paul

> What the problem we're trying to solve though there ?

This is in my test cases
@Single
public class CircularCat {
	@Inject
	private CircularMouse mouse;
	
}


@Single
public class CircularMouse {
	
	@Inject
	private CircularCat theCat;

}

Forget the @Single (although I could submit a patch for this one as
well). This example would not be resolvable with CDI but with
annotations, nothing prevents of creating the two instances and then
injecting the references. Circular injections make only sense when the
instances are cached. I'll work on a patch for this.

Then I said something stupid about the builder and caching (it happens
once in a while). By default in the builder, there is no caching. My
apologies! 
However, I'd vote for removing all the constructors in
DefaultPicoContainer that create CAF factories. DPC has 10 public
constructors (!).

Btw, in the CachingBehaviorFactory why is the constructor referencing
the AnyInjectionFactory? (AdaptiveInjection sounds way better). How
would this work if you want caching and CDI only?
    public CachingBehaviorFactory() {
        forThis(new AnyInjectionFactory());
    }


Erik.

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