> -----Original Message-----
> From: Berin Loritsch [mailto:[EMAIL PROTECTED]
> 
> [] for an array of components implementing the service
> {} for a map of components implementing the service
> /name for a specific instance implementing a service
> 
> Currently there is no standard way of doing this.  And (brace yourself for
> the
> "d" word) Phoenix is divergent from the common definition of acceptable
> return
> types from the ServiceManager due to the List and Map return values.
> 

I kind of like the [], {}, and / methods, but I'm not completely sold yet.

So if I understand it, the current methods of look up are:

Object   <- lookup("alias")
Object*  <- lookup(ROLE)
Object   <- lookup(ROLE+"/alias")
Object[] <- lookup(ROLE+"[]")
Map      <- lookup(ROLE+"{}")
Selector <- lookup(ROLE+"Selector")

* - in this case, you can either get the Object you are looking for, or a
ServiceSelector.  To be really safe, you have to test for both.
 
> * No "role" attribute identified--get the default implementation of the
>    service and apply it as normal (i.e. current standards).

Sounds good.

> * One or more "role" attribtues identified with names--supply the
>    implementations of the type that the assembler identifies as that role.

Not quite following.  Do you mean something like:

@dependency type="org.proj.MyService" role="role1" role="role2"

MyService service = (MyService) serviceManager.lookup("role1");
MyService another = (MyService) serviceManager.lookup("role2");

> * One "role" attribute with the value "*"--all implementations of the type
>    need to be available to the component.

Something like this is probably needed.  Maybe this sounds like overkill,
but what about allowing some sort of regular expression?

> That leaves the decision up to the developer how they want to do it.  In
> some
> cases a role is important at assembly time, and in others it doesn't
> become
> important until run time.
> 
> What do yall think of the additional "role" attribute?

Probably step in the right direction; however, I think I (and other users)
will get 'role' and 'type' mixed up.

jaaron

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

Reply via email to