In large and complex software products managing configurable settings becomes a major pain. Two approaches I've seen to the problem are:
- have each component in the system load its own configuration from config files or registry settings.
- have a settings loader class that loads all the configurable system settings and have each component query the settings loader for its settings.
These approaches both feel wrong to me.
Are there any design patterns that could be used to simplify the problem? Maybe something that would take advantage of the dependency injection technique.