Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
dboreham
· 3y ago · 0 comments
Dependency Injection is just a fancy, obfuscating, name for global variables.
Comments
[–]
paulmd
3y ago
No. 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/refere...
[–]
justesjc
3y ago
Yup, seems to be a lot of stockholm syndrome here. Repeating marking literature...
[–]
endofreach
3y ago
Not really. Dependency Injection is the way of how to access „that global variable“ (and how to define it).
[–]
throwaway_au_1
3y ago
In what ways are DI and global variables similar?
[–]
molszanski
3y ago
global variables is dependency injection via global context. This is just one flavour