avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@apache.org>
Subject Re: Map and Array Dependencies
Date Tue, 01 Oct 2002 13:44:25 GMT
On Tue, 1 Oct 2002 22:59, Leo Sutic wrote:
> Just one more thing, Peter...
>
> I'm fine with the Array lookup.
>
> But the Map lookup looks a lot like a ComponentSelector.

yep. That was one of the original options proposed instead of Selector. The 
key difference is that with the Map the consumer can iterate through all the 
services.

> Is the difference that in both cases the component doing
> the lookup is intended to perform operations on *all*
> returned services, as opposed to just selecting one of them?
>
> That is, while with selector you did:
>
>  1. lookup selector.
>  2. select *one* service.
>  3. perform operation on service.
>
> But with Map / Array lookup you'd:
>
>  1. lookup Map / Array
>  2. foreach Service service in Map/Array do service.method ()

Sorta. The users of Selector know the criteria with which to aquire components 
but never know how many components back the selector. They can never iterate 
through them all or anything like that and can implement any sort of policy 
(from being a Factory, to a fancy map to a proper query resolver).

However a map is designed to allow the consumers of a service to iterate 
through the services. The keys in map are really only used to tag the service 
and probably don't mean that much to the consumer of the service.

Consider the question of a Broker or Exporter component that exports 
components (via RMI, AltRMI, SOAP, IIOP, intra-process or whatever). 

With fixed dependencies you end up having an "link" component for every object 
you want to export/brokered that registers exported object with broker 
service. Each of these links will de-register service on shutdown.

Now lets say you have 10 objects you want exported. That adds 12 more objects 
to your system when you really only need 1 object and the other 11 are work 
arounds for inflexibility of service provisioning.

-- 
Cheers,

Peter Donald
-----------------------------------------------------------
 Don't take life too seriously -- 
                          you'll never get out of it alive.
-----------------------------------------------------------


--
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