Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Dependency Injection is just a fancy, obfuscating, name for global variables.


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...


Yup, seems to be a lot of stockholm syndrome here. Repeating marking literature...


Not really. Dependency Injection is the way of how to access „that global variable“ (and how to define it).


In what ways are DI and global variables similar?


global variables is dependency injection via global context. This is just one flavour




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: