3 ms·
Dependency Injection is just a fancy, obfuscating, name for global variables.
by dboreham 4y ago
Dependency Injection is just a fancy, obfuscating, name for global variables.
- justesjc 4y agoYup, seems to be a lot of stockholm syndrome here. Repeating marking literature...
- throwaway_au_1 4y agoIn what ways are DI and global variables similar?
- endofreach 4y agoNot really. Dependency Injection is the way of how to access „that global variable“ (and how to define it).
- paulmd 4y agoNo. And injected classes aren't always even global, there is such a thing as a class-scoped dependency injection. https://docs.spring.io/spring-framework/docs/3.0.0.M3/reference/html/ch04s04.html https://docs.spring.io/spring-framework/docs/3.0.0.M3/refere...
- molszanski 4y agoglobal variables is dependency injection via global context. This is just one flavour