News for hackers. Stuff that matters.
Re:The Problem with Dependency Injection Frameworks by dboreham on Sunday January 08, 2023 @04:37PM (#34303399)
Dependency Injection is just a fancy, obfuscating, name for global variables.
Re:The Problem with Dependency Injection Frameworks by justesjc on Sunday January 08, 2023 @04:43PM (#34303466)
Yup, seems to be a lot of stockholm syndrome here. Repeating marking literature...
Re:The Problem with Dependency Injection Frameworks by throwaway_au_1 on Sunday January 08, 2023 @06:32PM (#34304593)
In what ways are DI and global variables similar?
Re:The Problem with Dependency Injection Frameworks by endofreach on Sunday January 08, 2023 @08:49PM (#34305738)
Not really. Dependency Injection is the way of how to access „that global variable“ (and how to define it).
Re:The Problem with Dependency Injection Frameworks by paulmd on Sunday January 08, 2023 @11:37PM (#34306800)
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...

Re:The Problem with Dependency Injection Frameworks by molszanski on Monday January 09, 2023 @09:47AM (#34310879)
global variables is dependency injection via global context. This is just one flavour