An adaptable configuration system
For a project I develop at work, we have a similar problem: what to use for configuration files. In previous developments (under Windows but the problem remain the same), we used INI files, registry, registry mimic via directories and text files.
None was perfect, and the bad new is that each time our code depend on that configuration system.
So we develop a configuration front-end, using configuration resource URL, and entity name in that configuration resource. A function resolve the resource URL and the entity name and return an object which allows to access informations about the entity at the URL (after that informations are stored as paired name=value grouped by logical named sections).
Our code has not to know about configuration storage format and it has not to know about the protocol to access the information and the storage format, its processed by intermediate tools in the configuration library.
Currently we have only support for our text file format (see below), but i'm working on registry storage access (to include one of our new libraries into an older project - this library will need no code modification to use registry in place of text file).
Such a configuration tool allows you to store configuration data anywhere (maybe on remote computer, accessing it via LDAP or CORBA or SQL...), again its upon the configuration protocol support libraries to deal with that and to offer a standard interface.
Ex. of URL: fileconf:C:\confs\myconfig.txt
Ex. of URL: regconf://HKLM/Software/LURE/Disp
Ex. of our text configuration file
# This is a conf file
# Start an entity:
# Start a section
# Start another section
# Start another entity
#... & co
CNRS - LURE