avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: Java 1.5, fun with lookups and generics
Date Wed, 28 Jan 2004 16:56:22 GMT
Leo Sutic said:
> we all hate the:
>
>     MyComponent comp = (MyComponent) lookup (MyComponent.ROLE);

>     ServiceManager sm = new DefaultServiceManager();
>     A a = sm.<A>lookup ("A");

MyComponent comp = sm.<MyComponent>lookup( "MyComponent" );


And that would be compile time checkable???

The construct, IMHO, does not look any "nicer", so it'd better be
compile time type safe... (even though I fail to see how :o(  )

Niclas



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message