Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.0-beta-5
-
Fix Version/s: 2.8
-
Component/s: PicoContainer (Java)
-
Labels:None
Description
Currently the creation of the default parameters is hard-wired in ICA.createDefaultParameters(). We had now 3 issues on the list, where another Parameter-Implementation instead of ComponentParameter would have been better:
Configuration aware (Julian Stern's problem):
- http://lists.codehaus.org/pipermail/picocontainer-dev/2004-April/003406.html
Thomas Heller's AutoConfigParameter: - http://lists.codehaus.org/pipermail/picocontainer-dev/2004-April/003407.html
Thomas Heller's problem with the Pico autoregistration: - http://lists.codehaus.org/pipermail/picocontainer-dev/2004-April/003295.html
We might either move createDefaultParameter to (Mutable)PicoContainer or to create a container that overwrites the fucntion or have an additional ctor arg for ICA:
class ICA {
public ICA(Object componentKey, Class componentImplementation, Parameter[] parameters, ParameterFactory factory){
...
}
public ICA(Object componentKey, Class componentImplementation, Parameter[] parameters){
this(comüponentKey, componentImplementation, parameters, new DefaultParameterFactory())
}
}
class ParameterFactory() {
Parameter getDefaultParaeterForType(Class type);
}
PROPOSAL:
========
Add a ParameterFactory as optional Parameter to DefaultPC and create the method PicoContainer.createDefaultParameter(Class type).
BENEFIT:
========
PICO-216he can turn off collections, with Thomas' AutoConfigParameter he can use a configuration as default or with Nick's constraintsPICO-206create even more sophisticated strategies.PICO-216he can turn off collections, with Thomas' AutoConfigParameter he can use a configuration as default or with Nick's constraintsPICO-206create even more sophisticated strategies.