avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <nic...@hedhman.org>
Subject Re: MutableConfiguration
Date Thu, 05 Feb 2004 11:36:58 GMT
On Thursday 05 February 2004 17:44, Leo Sutic wrote:
> There is really only one way to prevent it:
>     Make sure that the object passed to the component doesn't
>     implement MutableConfiguration.
> This can be done in two ways:
>  1. By wrapping the DefaultConfiguration in a proxy that only
>     implements the Configuration interface and which doesn't
>     have any mutators.


>  2. By not having MutableConfiguration in a classloader that
>     is common to the client and the container. This means that
>     MutableConfiguration.class for the client won't be equal to
>     MutableConfiguration.class for the container, and the cast
>     will fail. In a sense, as far as the client is concerned,
>     DefaultConfiguration doesn't implement MutableConfiguration,
>     since it implements the container's MutableConfiguration, and
>     not the client's.

Hmmm.... Not sure what I feel about this. Somehow it doesn't sound like the 
right use of classloaders, and "easily" overridden by crafty users, creating 
other problems.

3. Don't pass the same object to the component. Rip out the result of the 
MutableConfigurator implementatation and stuff it into a Configuration 
implementation and hand that down to the component. To me this is the obvious 
and easiest solution.


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

View raw message