You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@excalibur.apache.org by Torsten Schlabach <ts...@apache.org> on 2005/03/25 18:46:11 UTC

Rountrip for configurations?

Dear all,

I have a quite simple question:

Is a component configuration (some .xconf) meant to be a one-way street?
Is the basic idea that a component is configured from some .xconf file
that got written manually by a human beeing?

We would have a need for roundtrip configurations in the sense that the
component comes up, get's its initial configuration from the .xconf file,
then maybe later changes configured values from the Java code and wants to
save it back to the .xconf.

The only way I have seen this implemented is by having a save() method in
the component which will built the entire configuration from scratch an
serialize it. I think this is not only a cumbersome but also dangerous
approach as it can easily happen that some options in the .xconf file just
get lost because they might not be read and written back.

I wonder if it would be a good idea to move to a JDOM like approach which
would be to instantiate the .xconf in memory, change spefific elemnts and
write it back.

Is there already something like that?
Am I on the entirely wrong path?

Regards,
Torsten


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


Re: Rountrip for configurations?

Posted by peter royal <pr...@pace2020.com>.
On Mar 25, 2005, at 12:46 PM, Torsten Schlabach wrote:
> Is there already something like that?

http://svn.apache.org/viewcvs.cgi/excalibur/tags/Excalibur-Initial- 
Migration-From-Avalon/configuration/src/java/org/apache/excalibur/ 
configuration/merged/

that was one idea on that..

you would have a 'base' configuration that could be shipped with an  
application. it would be modified by the application, and a 'layers'  
that would sit atop the shipped configuration could be generated. when  
the app starts up again, the 'layer' and 'base' are merged.

depends on how your application works, but if you want to be able to  
ship configuration updates and maintain how the user has modified it,  
this works well.
-pete