You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Leandro Rodrigo Saad Cruz <le...@ibnetwork.com.br> on 2002/11/20 15:13:53 UTC

[PROPOSAL] Changing Configuration

Hi all.

I'd like to propose another impl of Configuration and another
SAXConfigurationHandler. He is my motivation.

I have a simple configuration like this

<some_service name="FileUpload">
	<component name="a">
		<>
		</>
		...
		...
	</component>
	<component name="b">
		<>
		</>
		...
		...
	</component>
</some_service>
<some_service name="AnotherOne">
	...
	...
	...
</some_service>

Suppose I want to modify just the configuration for component named 'a',
or the configuration for service named 'AnotherOne'. I'd have to rebuild
all my configuration object just to change a single line, I think that
*if* DefaultConfiguration established a parent-child relationship and
offered ,methods like addChild(int position,Configuration child) we
would be able to replace just the line we wanted. Example

<code>
Configuration willBeChanged = getConfigurationUsingSomeCriteria();
int position = willBeChanged.getPositionAccordingToFather();
Configuration parent = willBeChanged.getParent();
willBeChanged = new DefaultConfiguration();
parent.addChild(position,willBeChanged);
//serialize
</code>

I'm not aware of the consequences of a change like this and I am
proposing this because this is a functionality that I need. Do you need
this too ? Any comments ?


-- 
Leandro Rodrigo Saad Cruz
IT - Inter Business Tecnologia e Servicos (IB)
http://www.ibnetwork.com.br
http://jakarta.apache.org/ojb


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PROPOSAL] Changing Configuration

Posted by Greg Steuck <gr...@nest.cx>.
>>>>> "Leandro" == Leandro Rodrigo Saad Cruz <le...@ibnetwork.com.br> writes:

    Leandro> Suppose I want to modify just the configuration for
    Leandro> component named 'a', or the configuration for service named
    Leandro> 'AnotherOne'.

Leandro, according to Configuration javadoc:

 This is a "read only" interface preventing applications from modifying
 their own configurations. Once it is created, the information never
 changes.

So the Configuration doesn't appear to be the right place for mutator
improvements.

    Leandro> I'd have to rebuild all my configuration
    Leandro> object just to change a single line, I think that *if*
    Leandro> DefaultConfiguration established a parent-child
    Leandro> relationship and offered ,methods like addChild(int
    Leandro> position,Configuration child) we would be able to replace
    Leandro> just the line we wanted. Example

If you need the ability to dynamically change XML-like structures, maybe
DOM/JDOM is a better alternative for your application?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>