xp-framework/rfc — Issue #221: RFC XXXX: Allow combining application properties from multiple sources
Author: kiesel
Created: 2011-12-21 06:50:49+00:00
State: open

Scope of Change
==
The util.Properties API will be extended so it is possible to combine multiple Properties objects into one when querying property settings.

Rationale
==
Often, settings need to extend or modify a set of basic settings, while overwriting, completeing or resetting values. Two examples for this rationale:

* different web application profiles (dev, qa, prod) usually share most data, except connection DSNs and log settings.
* an application could choose to inherit database DSNs settings from a global Properties file, so they're not duplicated.

Functionality
==

* A class ```util.CompositeProperties``` will be introduced which allows combining multiple ```util.Properties``` to be grouped together and used "as one". Also, the interface ```util.PropertyAccess``` marks classes that serve as source of properties.
* Then, ```util.PropertyManager``` will be extended so it supports reading and managing property files not from one filesystem location, but from multiple filesystem paths. When ```PropertyManager``` finds ```Properties``` in multiple paths, it will return a ```CompositeProperties``` that groups all found objects.

Security considerations
==
n/a

Speed impact
==
```util.PropertyManager``` will be affected:

* ```hasProperties()``` will become slower in worst case, because it will have to search all paths. In best case, the ```Properties``` object is in first path element, then no impact is expected.
* ```getProperties()``` will become slower in general, as it has to search all path elements for properties in any case.

The overall performance impact is expected to be negligible, though.

Dependencies
==
n/a

Related documents
==