avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Simons <leosim...@apache.org>
Subject Re: [proposal] avalon 5 ComponentManager interface
Date Sun, 16 Jun 2002 10:51:01 GMT
On Fri, 2002-06-14 at 17:30, Stefano Mazzocchi wrote:
> Peter Royal wrote:
> 
> > nor have I seen an example that *requires* a hint, they can all be refactored
> > into a single lookup key.
> 
> Of course, this is trivial topology: any two dimensional infinite
> discrete sets can be mapped onto a one dimensional infinite discrete
> set.
> 
> The problem is not feasibility, is semantics.

yup.

> when you do something like
> 
>  lookup(x,y);
> 
> you are explicitly keeping the two dimensions separate, when you do
> 
>  lookup(x+y);
> 
> you are actually doing two conceptual things at once
> 
>  1) (x,y) -> x+y        [2-d mapping into 1-d mapping]
>  2) x+y -> component    [1-d mapping into 1-d mapping]
> 
> This looks like a hack imposed by a framework constraint that shouldn't
> be there.

and that last sentence isn't really true. Because doing those two things
at once eases the use of the lookup() method if there is no need for an
"y", and in a completely well-designed system there should very rarely
be a need for "y", this decision was made. It is not a hack.

IOW:
making the 2-d to 1-d mapping part of the caller instead of the callee
simplifies the use of the callee where there is only 1-d.

on a more pragmatic front, it is a pattern used in all other lookup
mechanisms.

- Leo Simons



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