commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <>
Subject Re: [Configuration] Issue with subset and substitution
Date Tue, 30 Mar 2004 07:24:21 GMT
I agree that the actual solution is ugly. So what do you suggest?

Almost all features of a HierarchicalConfiguration can be used through 
the Configuration interface; there is just an enhanced syntax for 
property keys passed in the getter methods.

The exception is XML handling. ConfigurationXMLDocument tries to convert 
a Configuration into a hierarchical XML document. This conversion at the 
moment makes indeed use of internal knowledge about the objects to 
convert because HierarchicalConfigurations are per se hierarchical. I 
think to avoid that the Configuration interface has to be changed.


Jörg Schaible schrieb:

> Oliver Heger wrote on Tuesday, March 30, 2004 8:31 AM:
>>The problem HierarchicalConfiguration and related stuff had with
>>SubsetConfiguration has to do with code in the
>>class that tries to determine a correct ConfigurationXMLReader
>>implementation for a passed in Configuration object. This
>>code tests if
>>the Configuration object is instance of HierarchicalConfiguration and
>>this test breaks if a SubsetConfiguration is passed.
> Yes, but this is really ugly. The code relies heavily on internals and if you apply a
delegator (like it is done with Subset) it breaks immediately.
>>I originally had suggested to add a getXMLReader() method to the
>>Configuration interface. This would solve out problem now
>>(ConfigurationXMLDocument could simply call this method and
>>work on the
>>returned reader). The reason why we decided against this was
>>to keep the
>>  interface simple and not add methods for a probably rarely
>>used feature.
> IMHO a hierarchical configuration should be directly covered by the standard Configuration
interface. Look e.g. at JNDI configuration. This should implement a hierarchical config also,
because it *is* a tree.
> Regards,
> Jörg
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Dipl.-Inform. Oliver Heger
Zentrale Informationsverarbeitung (ZIV) / Bereich Anwenderverfahren
Klinikum der Philipps-Universität Marburg
Bunsenstraße 3,
D-35037 Marburg
Tel: +49 6421 28-66592

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message