Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extensible configuration system

Status
Not open for further replies.

plasmatwin

Programmer
Nov 1, 2005
31
GB
Hi,

I'm writing a modular program (mainly as an experiment) and I would like some advice on passing the configuration of the program. What I would like is to be able to use a configuration file (preferably xml) to hold all the core configuration, aswell as different lumps of configuration that depend on what modules are loaded, aswell as describing what modules to load (and not just arbitrarily loading everything in a "plugins" dir). Also, I would like to be able to override these settings on the command line using command line switches, note that I may want to specify a different configuration file on the command line so the command line arguments need to be passed first. Finally, I would also like some sort of generic way of accessing this configuration so that if I decided to change from using an xml file to instead using a mysql database, I would be able to simply change the config parsing code, recompile and all the sections that read from, say, a "config" object will still have the same syntax.

Yeah... that was a little bit long winded, but I hope that someone from the oracle that is tek-tips could enlighten me on atleast the direction I need to be looking in to do this :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top