commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <ebo...@micropole-univers.com>
Subject Re: [Configuration] IniFile
Date Thu, 04 Mar 2004 17:12:03 GMT
What about a single class instead, IniConfiguration or 
WindowsConfiguration (I tend to prefer the later) extending 
BasePathConfiguration with new methods:

void load();
void save();
List getSections();
Configuration getSection(String name); // delegating to subset
void setProperty(String section, String key, Object value);
void getProperty(String section, String key);

Emmanuel Bourg


Inger, Matthew wrote:

> I think what i'm planning on is the following:
> 
> IniSectionConfiguration -
>  extends BaseConfiguration, and doesn't really do much else
>  except add a name attribute with a getter, and a save method
>  to write the section to an output stream
> 
> IniFileConfiguration - 
>   extends BaseConfiguration.  It contains a map, whose
>   key is section name, and value is an IniSectionConfiguration
>   object.  There will be getSection(String name) method which returns
>   an IniSectionConfiguration.  The existing "subset" method will delegate
>   to the getSection method.
> 
>   From the perspective of IniFileConfiguration keys are represented as:
> 
>        [section_name]keyName
> 
>   All of the get,add,clear, etc... methods will parse the key above and
>   find the correct section, and delegate the call to that section.
> 
> I think this is the cleanest solution.  Thoughts?



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


Mime
View raw message