Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 70279 invoked from network); 8 Dec 2002 00:26:58 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 8 Dec 2002 00:26:58 -0000 Received: (qmail 27780 invoked by uid 97); 8 Dec 2002 00:28:09 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 27764 invoked by uid 97); 8 Dec 2002 00:28:09 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 27752 invoked by uid 98); 8 Dec 2002 00:28:08 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Content-Type: text/plain; charset="iso-8859-1" From: Adam Murdoch To: "Avalon Developers List" Subject: Re: Locators (was: Re: Context: usage recommendations?) Date: Sun, 8 Dec 2002 10:22:38 +1000 User-Agent: KMail/1.4.3 References: <5.1.0.14.2.20021207205720.00bb06f8@mail.sutic.nu> In-Reply-To: <5.1.0.14.2.20021207205720.00bb06f8@mail.sutic.nu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200212081022.38676.adammurdoch@apache.org> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Several more problems with the narrowing approach: - Forces the container to use a proxy of some kind, regardless of whether= the=20 container needs to isolate components. Limits the container's options fo= r=20 scaling down. - Prevents the use of the same interface for multiple services (including= =20 super-interfaces). - Prevents delivery of things that are not interfaces (eg File or=20 ClassLoader). - Prevents additional services from being added during the lifetime of th= e=20 component. - Limits lookup and query mechanisms to cast and instanceof. Prevents us= =20 adding additional kinds of lookup and query methods later. =20 On Sun, 8 Dec 2002 06:03 am, 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 =3D ...; > > The two calls: > > ((A) proxy).method (); > ((B) proxy).method (); > > are indistiguishable. This is true even if you are using a dynamic prox= y'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. > > (Yes, I have a proposal of my own, writing it right now...) > > /LS --=20 Adam -- To unsubscribe, e-mail: For additional commands, e-mail: