1. How does config injection differ from method or constructor injection?
Config injection is an extended form of method and constructor injection. It intends to improve the UX of the code by hiding common and environmental concerns. This reduction in parameters makes the methods easier to understand, extend, and maintain.
2. How do we decide what parameters to move to config injection?
The key point to consider is how the parameter relates to the method or constructor. If the dependency is insignificant but necessary, such as loggers and instrumentation, then hiding it in the config improves the clarity of the function signature rather than detracting from it. Similarly, configuration coming from a config file is often necessary but not informative.
3. Why don't we inject all dependencies via config injection?
There...