|
From: Christian B. <kr...@di...> - 2003-02-03 03:38:28
|
hi there -- lot's of cool stuff recently! I understand there is a release coming up soon, so here is something that I personally find very useful: cascading configurations. if there is interest, I would be delighted to see this included in the upcoming version. cascading configurations: very simple hack, basically it allows to specify additional configuration files that are loaded after the main configuration file. if an additional configuration file specifies a property that is already specified, the value is replaced with the value from the additional configuration file. if the property hasn't been specified, it is simply added. this is very useful if you have to query for certain parameters upon installation of an app (via an installer or wizard) -- instead of rewriting the config file, everything that has been queried from the user can simply be put in an additional configuration file. this also helps to a certain degree for upgrading, ie. a new base configuration file can be shipped, but changes that have already been made to an existing installation will remain in the additional configuration and don't get lost (as long as the format of the properties does not drastically change, that is, but still...). it's also useful if you have to deal with different JVMs (for example IBM on AIX, Sun on Linux), since for example -server as a JVM parameter makes the IBM JVM very unhappy from my experience. here is how this works in my implementation: ./wrapper ../conf/wrapper.conf include.1=../user.conf.1 include.2=../user.conf.2 and so on. the order that additional configuration properties are applied is (of course) include.1, include.2, ... attached are 4 files (wrapper.h, wrapper.c, wrapper_unix.c, wrapper_win.c) that are changed to implement the described functionality. the implementation is quick and dirty, but works for me. it was originally done against 2.2.9, but I just got the latest beta for 2.3.0 (link was in Leif's mail from Mon, 20 Jan 2003 19:39:03 +0900) and moved the changes over there -- this is hopefully making it easier to diff against the current version of the code (plus my 2.2.9 was polluted by other stuff; also, I'm sorry for being too stupid and lazy to learn how to use diff and patch). since I can make very good use of this functionality, I would be happy to see this going into the codebase -- this safes me from having to maintain a private fork ;) -- I am neither in love with my implementation nor with the names I chose for functions and parameters, so feel free to change all that to comply with your naming scheme and general ideas if you want. thanks, chr. |