You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Xiaowei Jiang <xi...@stratify.com> on 2002/04/30 16:59:32 UTC
modify Configuration object
Currently, Configuration interface only define accessor methods and doesn't
allow you to modify it. I guess this design decision was made because that't
the minimal interface needed to use Configuration. However, in real life,
it's sometimes necessary for a component manager to modify a Configuration
object a little bit before pass it to a component. Downcasting it to
DefaultConfiguration would lose the whole point of this interface
abstraction. One possible clean solution is to make a copy of this
Configuration to a DefaultConfiguration object and modify the resulting
DefaultConfiguration object. So I suggest add a static method copyFrom in
class DefaultConfiguration:
class DefaultConfiguration {
public static DefaultConfiguration copyFrom(Configuration
configuration);
}
In this way, user can modify Configuration object easily on the copy. I
would like to hear others' opinion on this.
xiaowei
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: modify Configuration object
Posted by Peter Donald <pe...@apache.org>.
On Wed, 1 May 2002 00:59, Xiaowei Jiang wrote:
> class DefaultConfiguration {
> public static DefaultConfiguration copyFrom(Configuration
> configuration);
> }
>
> In this way, user can modify Configuration object easily on the copy. I
> would like to hear others' opinion on this.
Sounds good - wanna supply a patch ? :)
--
Cheers,
Peter Donald
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>