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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>