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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to