On Thursday 14 April 2005 11:32, J�rg Schaible wrote:
> > Many application ini files have some kind of default-section.
> > Consider the following ini-file:
>
> [snip]
>
> well, such a behaviour would be different from all other configuration
> implemnetations and I don't think it is worth the hassle. You can have the
> same functionality with CompositeConfiguration either by using two files or
> two subsections:
You're right when it comes to new configuration files / new applications. But
then, I wouldn't use ini-files. I think of existing applications and existing
ini-files with this schema.
Another approach could be to write a facade for this - something like:
public Object getProperty(String key)
{
Object o = super.getProperty(key);
if (o == null)
{
int pos = key.indexOf(".");
if (pos == -1)
{
key = this.defaultSection + "." + key;
}
else
{
key = this.defaultSection + key.substring(0, pos);
}
o = super.getProperty(key);
}
return o;
}
...just an idea...
Best,
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]