avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: Dispose and dependencies not only in Fortress
Date Mon, 19 May 2003 12:40:34 GMT
Anton Tagunov wrote:
> Hello, Berin!
> 
> BL> It requires using the @avalon.dependency type="my.com.Role"
> BL> doc tag to provide the dependency information.
> 
> Does this approach have the potential to grow into an architecture
> where Components will be allowed to lookup _only_ the roles
> that have been specified in @avalon.dependecy (or via some other
> way in the meta-descriptors) ?

Yes.  In fact, our more full featured containers already implement
this.  I merely took the already declared usage pattern from them,
and implemented it in a less strict way in Fortress.

> 
> Maybe not now but in Avalon 5 ?

No, it is preferable to limit the scope of what a component can
lookup, but there are some things to work out first.

> 
>   <implementation-thoughts>
>   I doubt how much overhead this may bring.
>   Probably each component class could be wrapped into an
>   additional auto-generated subclass (this will strictly require BCEL)
>   that would overload the service() method - and in this method the role
>   might be compared against a static HashSet or sequentially
>   against every role in the list - shouldn't take long as
>   the list of used components is usually quite limited, isn't it?
>   Probably if it is enough to compare strings as '==' not .equals.
>   (only the generated strings that have not been .intern()-ed
>   are an issue, aren't they? but such case may be safely ignored,
>   especiall as everyone uses Blah.ROLE)
>   </implementation-thoughts>

There are other ways of doing it without requiring BCEL.  In fact,
since every component gets their own instance of the servicemanager,
it is very easy to only map what needs to be mapped.

-- 
"You know the world is going crazy when the best
rapper is a white guy, the best golfer is a black guy,
The Swiss hold the America's Cup, France is
accusing the US of arrogance, and Germany doesn't want
to go to war. And the 3 most powerful men in America
are named 'Bush', 'Dick', and 'Colon' (sic)".

-----Chris Rock


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message