Property Guidelines

We'll be using XProperties from sbutil. XProperties extends Properties, provides nested properties and a readable XML-format input/output format.

If the system property dk.statsbiblioteket.doms.config.url is set, the properties will be loaded from the resource from that url, otherwise the classpath will be searched for the resource.

Conventions

Regarding namespaces: Please consider that the reason we enforce proper namespacing of properties is that we want the properties to be meaningful and unambiguous in the context of other applications and third party modules.

Nested Properties

From other projects it has been experienced that the flat property-value map is too limiting to be useful for rich configuration systems. To counter this problem it has been decided to use a system where nested properties is possible. Fx if prop is a Properties object prop.get("myapp.server.config") could return another Properties object with settings specifically for the server part of myapp.

Global Configuration

It is expected that our setup will involve a handful applications running on (possibly) differrent servers. To ease configuration we use one centralized configuration file located at one designated configuration server (needs http server) and pass the location as an URL to be loaded via the standard Java resource system.

Each module will have a sub-XProperties object within the global properties file.

Reloading Properties

For the purpose of changing configurations of running system we establish the following conventions:

Default Properties

Command Line Overrides

There are several variations of command line overrides for XProperties.

More clever command line updates are under consideration (lists would be nice).

PropertyGuidelines (last edited 2010-03-17 13:13:45 by localhost)