Issue Details (XML | Word | Printable)

Key: PICO-216
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Joerg Schaible
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
PicoContainer

Refactor ComponentParameter and GenericCollectionComponentAdapter

Created: 01/Oct/04 09:02 PM   Updated: 19/Oct/04 05:33 PM
Component/s: PicoContainer (Java)
Affects Version/s: 1.0
Fix Version/s: 1.1

Time Tracking:
Not Specified

Issue Links:
Related
 
Supercedes
 


 Description  « Hide
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


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Joerg Schaible added a comment - 01/Oct/04 10:33 PM
PROPOSAL:
========

Add a ParameterFactory as optional Parameter to DefaultPC and create the method PicoContainer.createDefaultParameter(Class type).

BENEFIT:
========

  • User can influence or completly change the strategy for selecting the default parameters. With PICO-216 he can turn off collections, with Thomas' AutoConfigParameter he can use a configuration as default or with Nick's constraints PICO-206 create even more sophisticated strategies.

Paul Hammant added a comment - 05/Oct/04 08:08 AM
Sounds good.

Joerg Schaible added a comment - 19/Oct/04 05:33 PM
Backward-compatible refactoring done. Can now collect Collections and Maps though