|
|
|
|
|
by culturedsystems
384 days ago
|
|
"It is very annoying when you need to add a dependency and suddenly you have to touch 50+ injection points because that thing is widely used" You don't have to update the injection points, because the injection points don't know the concrete details of what's being injected. That's literally the whole point of dependency injection. Edited to add: Say you have a class A, and this is a dependency of classes B, C, etc. Using dependency injection, classes B and C are passed instances of A, they don't construct it themselves. So if you add a dependency to A, you have to change the place that constructs A, of course, but you don't have to change B and C, because they have nothing to do with the construction of A. |
|