commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject Re: [configuration] Thoughts about multi-threading
Date Thu, 20 Sep 2012 06:57:24 GMT
Oliver Heger wrote:

> Hi Jörg,
> many thanks for your input!
> Am 17.09.2012 10:01, schrieb Jörg Schaible:


>> However, what also bugs me in the meantime is the current hard relation
>> between the configuration object and its format. Why should I care at all
>> in what format the configuration had been saved when I access its values?
>> For some time I am thinking now of something in the line of:
>> - interface Configuration: Core interfaces, only getters
>> - interface ReloadableConfiguration extends Configuration, Reloadable
>> - class BaseConfiguration: In memory, implements all the stuff for
>> interpolation and the setters
>> - interface ConfigurationSource: Core interface to load (and probably
>> save a configuration)
>> - class PropertiesConfigurationSource: Concrete implementation that loads
>> a properties file and creates a BaseConfiguration
>> This approach offers immutability for the Configuration itself and also
>> allows Serializability. Format is separated completely from the
>> configuration functionality.
>> I know, this looks more like Configuration 3.0 ... ;-)
> I really like this approach. I was also thinking about separating
> loading and saving from core Configuration classes. However, I fear such
> an approach will make it difficult to preserve the format of a
> configuration. E.g. XMLConfiguration currently stores the XML document
> it was loaded from. So when saved to disk, result looks much like the
> original document.

A ConfigurationSource may still collect the necessary data and keep it 
internally or attach it somehow to the generated Configuration instance for 
later use.

- Jörg

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

View raw message