Issue Details (XML | Word | Printable)

Key: PICO-181
Type: Improvement Improvement
Status: Open Open
Priority: Minor Minor
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 creation of default parameters

Created: 26/Apr/04 07:50 AM   Updated: 21/Oct/08 03:43 PM
Component/s: PicoContainer (Java)
Affects Version/s: 1.0-beta-5
Fix Version/s: 2.7

Time Tracking:
Not Specified

Issue Links:
Related
 


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

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);
}



 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:14 AM
I'd prefer a ParameterizedPicoContainer or ParameterizingPicoContainer. Somewhere where we would move perhaps all component-parameter functionality to.

Joerg Schaible added a comment - 28/Nov/05 05:12 PM
Note, this is scheduled for 1.3

Joerg Schaible added a comment - 28/Nov/05 05:14 PM
Fix relationship.