Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 535 Bytes

TransientPicoContainer.md

File metadata and controls

17 lines (14 loc) · 535 Bytes
layout title
article
TransientPicoContainer

TransientPicoContainer is a for short term needs for object instantiation, where the container is going to be de-referenced shortly after use.

Here is an example of use:

public Foo makeSuitableFoo() { 
	MutablePicoContainer temp = new TransientPicoContainer(someParentContainer); 
	temp.addComponent(somethingElseThatMightBeNeeded); // by instance 
	temp.addComponent(Foo.class, FooImpleThatNeedsTheAbove.class); // by type return 
	temp.getComponent(Foo.class); 
}