avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject The need for 'hints'
Date Fri, 14 Jun 2002 14:34:28 GMT
Peter Donald wrote:
> 
> Berin wrote:
>
> >ConnectionManager ssl = (ConnectionManager)
> >         m_manager.lookup(ConnectionManager.ROLE + "/SSL");
> >
> >and this:
> >
> >ConnectionManager ssl = (ConnectionManager)
> >         m_manager.lookup(ConnectionManager.ROLE, "SSL");
> 
> Loss of clarity and added complexity.
> 
> 2 extra methods that are uneeded except by Cocoon.

I'll try to keep this abstract and I remove my cocoon hat.

First, 

 ConnectionManager ssl = (ConnectionManager)
         m_manager.lookup(ConnectionManager.ROLE + "/SSL");

is a hack. 

I'm pretty sure that this is obvious to everyone.

Now Peter asks: do we really need hints?

Let me try to ask this

                                - o -

Play example
------------

An actor asks the director who is the actor who plays a particular role
*AND* will act as a replacer if the actor appointed for that role is
sick the night the play gets on stage.

If you don't have hints, it is up to the director to know that in that
particular lookup, the actor wanted to do a particular 'flavor' of that
lookup.

Is the behavior ignorable? yes, totally. A director might not take into
consideration the lookup flavor and simply perform a lookup.

What, How and Who
-----------------

A two-dimensional lookup is required when the knowledge of the lookup is
obtained by aggregating information from two separate concerns. The
first dimension is the role (what), the second dimension is the hint
(how).

The lookup mechanism hides the "who", which is given by the director
inverting the control and allowing transparent polymorphism.

But I do not understand what is wrong in allowing a component to ask for
"what" and suggest "how", since it is its own concern to use that
component so it must have the control to specify both 'what' and 'how'.

I think this concept is elegant and general enough to deserve to remain
in the next version of Avalon.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



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