I have similar problems. For me hasComponent() makes all the sense.

BTW, hasXxxxx() makes sense EVERYWHERE (Context, etc) although its
use might not be so frequent. Checking for exceptions is a kludge.


Besides, the more I see the arguments on
   lookup(String role, Parameters params)
versus
   lookup(Query query)
or whatever, the more I like
   lookup(Object someKey)

Although I have several specialized versions of Maps (e.g.:
NamedMap, InstanceMap, etc.) that might accept and be limited to
different kinds of keys, the underlying implementation tends to
always be the old HashMap and its java.lang.Object key.

So, if you are talking generic, do it _really_ generic and then
specialize.


Have fun,
Paulo Gaspar



> -----Original Message-----
> From: Sylvain Wallez [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 13, 2002 9:57 PM
> To: Avalon Developers List
> Subject: Re: Resolver package--Please post your thoughts
>
>
> Berin Loritsch wrote:
>
> > Sylvain Wallez wrote:
> >
> >> Berin Loritsch wrote:
> >> > To have the equivalent of ComponentSelector.hasComponent(Object
> >> hint), you also need :
> >>
> >>    boolean hasComponent( String role, Parameters params);
> >
> >
> > No.  All we need to check is that there is at least one
> implementation of
> > a role.  If there is none that are specialized, the default
> implmentation
> > is returned.
>
> Mmmh... Let's consider a very practical case (sorry for cocoon-dev
> flooding on avalon-dev ;) : in a Cocoon sitemap, we have e.g. a
> <map:generate type="file">. How can we check at sitemap load time if
> there actually exists a "file" specialization for the Generator role and
> that this statement is valid ? De we have to resort to a
> lookup()/release() and see if no exception occurs ?
>
> Sylvain
>
> --
> Sylvain Wallez
> Anyware Technologies - http://www.anyware-tech.com
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to