My program consists from several "services" (I'm not talking about SOA, so don't get confused), and each of these "services" is using some configuration (for example, a directory path). This configuration should be read from a configuration file, as they tend to change (without changing the program's logic, that is).
So my question is this - Should each "service" receive its configuration when invoked, or should it be responsible for getting its own configuration?
This question is actually very similar to this question, only mine is more specific about these:
- My program's "services" aren't generic, and aren't supposed to be re-used by another. They already use generic tools, and their functionality is to simply connect between those tools. This means that it is not immediately obvious for them to receive their configuration, as their target is very clear and direct.
- The target of these "services", being clear and direct, sometimes requires more than one action. This means that my "services" aren't necessary responsible for only one action (although you might separate between logic and preparations such as configuration).
Thanks.