Leo Sutic wrote:
Stephen wrote:
> * Service locator
>
> This is a new concept that is very similar to the
> Merlin extension handler. It a component that provides
> a plug-in lookup solution that can be narrowed to a
> particular interface (and can be located by the container
> using the interface name as the key). A service locator
> can be applied to the following three areas:
>
> * context value lookup
> * service lookup
> * lifecycle stage handler lookup
If you have two interfaces:
interface A {
void method ();
}
interface B {
void method ();
}
and a dynamic proxy (or any class) implementing both interfaces:
class Proxy implements A, B {
...
}
Proxy proxy = ...;
The two calls:
((A) proxy).method ();
((B) proxy).method ();
are indistiguishable. This is true even if you are using a dynamic proxy's
InvocationHandler. (In which case they will both be calls to A.method.)
Unlike C#, Java has no way of distinguishing through what interface the
call was made.
I think this makes your idea less useful.
It is a restriction that can be detected at build time. Assume that you have meta data associated with a locator, you can assess conflicts at two levels: (a) interface conflicts, and (b) duplicate key conflicts.
Cheers, Steve.
--
Stephen J. McConnell
OSM SARL
digital products for a global economy
mailto:[EMAIL PROTECTED]
http://www.osm.net
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
