I think that looking up things by role is a well defined operation, i.e. 
"Hey, get me something that implements this interface!", so I think we 
shouldn't break the pattern. That's why I would consider the following:

   public interface Resolver {

     Object lookup(String uri);
     Object[] lookup(String[] uris);

     Object lookupByRole(String role);
     Object[] lookupByRole(String[] roles);


We could then define

   lookupByRole("com.mycompany.MyComponent");

to be equivalent to

   lookup("role://com.mycompany.MyComponent");

while being easier to use and not suffering from the additional cost of 
parsing the URL. I think usability is more important than 'elegance', so 
I wouldn't object to even adding something like:

   Object lookupByRoleAndHint(String role, Object hint);

Well, that might be a bit too much, but I'd like to hear your opinions 
all the same. It could potentially make the migration from CM/CS easier, 
although that probably shouldn't be our primary concern.

(: Anrie ;)



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

Reply via email to