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