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.

I agree here.  I think that was the result of the Map question
a long time ago.  The biggest problem with the Map I have is that
it must be an Unmodifiable Map.  Noone should be able to bind
new services to that Map, or change the bindings that are there.

What does Map provide that XXXSelector doesn't?


> 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 a key question.  With arrays, I have a sneaking
suspiscion that the exact indexes of the components will
change as we change the number of components.  That can spell
disastor for someone who is banking on the behavior of
component 6 returned from an array.  If the array is smaller
we get an IndexOutOfBoundsException.  If the array has a
new element inserted at position 5, then what used to be
6 is now 7.

Arrays are bad for predictability in that sense, and they
take too long to linearly search them for the specific
component we want.


> That is, while with selector you did:
> 
>  1. lookup selector.
>  2. select *one* service.
>  3. perform operation on service.

Which is what I would expect.  A component should know its
dependencies up front.

> 
> But with Map / Array lookup you'd:
> 
>  1. lookup Map / Array
>  2. foreach Service service in Map/Array do service.method ()


I don't like this from a security perspective.  What you are
doing is making it alot easier to write trojan components
that operate on all the services.  In essence we are giving
up too much control.

When you develop from a forknowledge perspective, you know
what needs to be there to work and you use it.  When you
develop from a discovery perspective, things are more
flexible, but at a high price.  Just look at all the issues
with IIS.  Microsoft can make things easy, but they have
a hard time making things secure.



-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


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

Reply via email to