4 ms·
Configuration can come from different sources, it can be reloaded, it can be lazy-loaded, there are so many different reasons why config is more like service an
by hudo 9y ago
Configuration can come from different sources, it can be reloaded, it can be lazy-loaded, there are so many different reasons why config is more like service and not a static variable.
It has to be injected.
Maybe you're using it in a way static access makes sense, but when you're designing generic Configuration solution, its whole another set of problems, requirements and constraints.
- rraghur 9y agoI sort of agree that config is more of a service.. but I had the same reaction as the parent here that logging had to be injected! That just felt insane!
- mattmanser 9y agoNo it's not. We've had app config for the last 20 years. When you need mutable config put it in the db. There is a case for a mutable config, but it should be a separate class, and still wouldn't need to be a service.