avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antti Koivunen <anryo...@users.sourceforge.net>
Subject Re: [VOTE] RE: ComponentManager interface
Date Thu, 14 Feb 2002 05:44:54 GMT
Stephen McConnell wrote:
<skip/>
> 
>   interface ServiceManager
>   {
>      Object lookup( final String role );
>      Object lookup( final String role, Map policy );
> 
>      boolean hasService( final String role );
>      boolean hasService( final String role, Map policy );  <-- addition ?
> 
>      void release( Object key );
>   }
> 
> The addition of hasXxxxx( key, policy ) ensures that your not going 
> on a blind date.

I agree, it's more consistent and required for something like:

   map.put("mime-type", "video/mpeg");
   boolean ok = sm.hasService(Codec.ROLE, map);

There are many other cases where the policy/hint would just be a simple 
string. As the use of a Map has some performance implications, I might 
consider adding also:

   Object lookup( String role, String hint );
   boolean hasService( String role, String hint );

The hint could be something simple, such as a mime-type, protocol or 
URL, but it would also allow the use of string queries, if necessary.

What do you think?

(: A ;)



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


Mime
View raw message