RE: [picocontainer-dev] [Paul?] DPC.initForConfig()
Jörg Schaible <[email protected]>
| Newsgroups | gmane.comp.java.picocontainer.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Konstantin + Paul,
Paul Hammant wrote on Wednesday, August 15, 2007 1:51 PM:
> I see your point Konstantin.
>
> If we were to imagine ConfigAdapter in the style of InstanceAdapter
> for exclusive use by addConfig(..) what what would it do that is
> different ?
>
> All the work is done in BasicComponentParameter.getTargetAdapter(..)
> - it would be there that we change functionality, if we were to
> change it.
>
> Before we change anything though, what would happen in the following
> scenario ..
>
> public class NeedsString {
> public NeedsString(String foo) { .. }
> }
> dpc.addComponent(NeedsString.class)
> dpc.addComponent(String.class,"is it me you're looking for?");
> dpc.addConfig("foo","is it me you're looking for?");
> dpc.getComponent(NeedsString.class)
> // ?
as long as we manage the config params like components, we do not have much difference. Therefore again: IMHO we need an additional callback interface that is used when the other deps are resolved - something like
interface ParameterProvider {
Map<String, Object> getParameter(key, componentType);
}
The key is the key of the component to resolve (so config params can be correlated).
- Jörg
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email