When your application takes several (~ 5) configuration parameters, and the application is used by users who do not use technology (i.e. KISS ), how do you usually handle reading configuration parameters, and then bypass parameters between objects / functions (several modules) ?
Examples of options: I / O directories / file names, level of detail.
I usually use optparse(Python) and bypass parameters / parameters as arguments; but I wonder if it is more common to use a configuration text file that is read directly by the objects of all modules (but then is it not so, for example, to have "global" variables ?, and without "owning" the state?).
Another common problem is unit testing; if I want to unit test each individual module, a separate module may require only 1 of 5 configuration options; how do you usually separate individual modules / objects from the rest of the application, and still allow to accept 1 or 2 required parameters (is it really possible to call the unit test structure or use the configuration functions)?
I suppose that there is not the only right way to do this, but it would be interesting to read about various approaches or well-known patterns.
source
share