Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0
-
Fix Version/s: 1.1
-
Component/s: PicoContainer (Java)
-
Labels:None
-
Number of attachments :
Description
SITUATION:
========
The current support for GenericCollections is hacked into the ComponentParameter's dependencies resolution. Additionally we cannot support empty collections. Use case:
class Observer{
Observer(Listener[] listeners)
}
Now imagine the listeners are provided by configuration and none is configured ==> suddenly we have an unresolved dependency.
PROPOSAL:
========
Refactor out the resolution of non-collecting arguments into a SingleComponentParameter and derive ComponentParameter from this one supporting collections. Add an optional boolean ctor parameter to ComponentParameter to allow empty collections as valid result.
BENEFITS:
========
- Cleaned-up implementation of two separate resolution strategies.
- User has the choice to drop the collection at all.
- Entirely backward compatible
Issue Links
Activity



Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Fix Version/s | 1.1 [ 10307 ] |
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.