Oliver Heger wrote: > Hi Jörg, > > many thanks for your input! > > Am 17.09.2012 10:01, schrieb Jörg Schaible:
[snip] >> 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: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org