Re: [picocontainer-dev] Chg 4832 - Generic collections process like arrays do now.

Mauro Talevi <[email protected]> Sun, 06 Jul 2008 22:57:58 +0100
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Paul Hammant wrote:
> Paired with Pete yesterday, a change to Parameter has allowed components 
> to have generic collections as a declared injectable.
> 
> We're at a crossroads though, there are three methods in Parameter that 
> need to change somehow:
> 
>   Object resolveInstance(PicoContainer container, ComponentAdapter 
> adapter, Class expectedType  ...etc
>   boolean isResolvable(PicoContainer container, ComponentAdapter 
> adapter, Class expectedType  ...etc
>   void verify(PicoContainer container,  ComponentAdapter adapter, Class 
> expectedType  ...etc
> 
> We could change the third param to Type from Class
> 
>   Object resolveInstance(PicoContainer container, ComponentAdapter 
> adapter, Type expectedType  ...etc
>   boolean isResolvable(PicoContainer container, ComponentAdapter 
> adapter, Type expectedType  ...etc
>   void verify(PicoContainer container,  ComponentAdapter adapter, Type 
> expectedType  ...etc
> 

Type is more generic and makes more sense in JDK1.5+, because it is the 
interface that Class implements (so no loss of functionality in 
refactor) but also has as subtype ParameterizedType - which allows to 
distinguish genericized params, eg
List<Object1> from List<Object2>,


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email