[Mulgara-dev] A better approach to config files?

Alex Hall alexhall at revelytix.com
Thu Jun 4 14:38:59 UTC 2009


Paul Gearon wrote:
> On Wed, Jun 3, 2009 at 5:04 PM, Alex Hall<alexhall at revelytix.com> wrote:
[snip]
>> Merging two copies of the config structure seems like a reasonable
>> approach.  The one difficulty that I see here is that this approach only
>> lets you add new components or override existing ones.  It would not
>> cover the case where, for instance, the user wishes to disable one of
>> the resolvers.
> 
> We could just accept a new attribute, like "disable". So if you want
> to disable the FileSystem resolver (I can see this being a common
> requirement), you could have this in your user-configuration file:
> 
> <ResolverFactory
> type="org.mulgara.resolver.filesystem.FileSystemResolverFactory"
> disable="true"/>

This would be the most natural approach, and the one that came to my
mind as well.

> We'd need to make sure that the user configuration overrides the
> system config, and not simply merge them, since a merge will lose the
> info of who said what. Otherwise, if both disable="false" (the
> default) and disable="true" are both present, we need to always listen
> to the disable="true" (as in the example above). But that means that
> if a resolver is disabled in the system configuration, then the user
> will not be able to enable it.

Yes, "merge" was a poor choice of words.  "Override" is a more precise
definition of what we want to do.

Regards,
Alex



More information about the Mulgara-dev mailing list