Configuration
There are three basic levels of configuration in [fleXive]:
- global - for configuration parameters affecting the whole installation, e.g. data sources or domain mappings,
- division - division-wide configuration parameters, and
- user - user settings that every user may adjust.
Configuration options propagate in the order listed above, that is, if a user option is not set, the division parameter is used, if the division parameter is not set, the global parameter is used, and if the global parameter is not set, an internal and probably undocumented default value is used.
Parameter definition
A parameter consists of its primary scope (e.g. division), a path (e.g. /config/tree), a key (e.g. key1), an optional default value (depending on its type), and the actual configuration value. Fallback scopes can be used for providing configurable default values (e.g. a user-scoped parameter may use a division parameter setting as fallback if the user hasn't set the parameter yet).
Parameter types
[fleXive] provides a type-safe interface for reading and updating configuration parameters for the most common types (currently String, Boolean, Integer). By defining static parameter instances in the respective classes (e.g. StringParameter for String values), programmatic access is relatively easy and does not require casts.
Parameter paths
To avoid using conflicting paths, paths are enumerated in enum ParameterPath. A path entry also defines the scope for its parameters, including possible fallback scopes.
Configuration APIs
For low-level access there are three generic APIs for global, division and user parameters. The FxConfiguration interfaces wraps all three scopes and supports fallback scopes.
Example
TODO