Should the usage of DI/IoC remove all occurrences of the “new” keyword?
https://softwareengineering.stackexchange.com/questions/102023
-
02-11-2019 - |
Question
Should the usage of Dependency Injection and an Inversion of Control container remove all occurrences of the "new
" keyword from your code?
In other words, should every object/dependency, no matter how simple or short-lived, be "registered" within your IoC container and injected into the method/class that needs to use them?
If no, where do you draw the line between which dependencies/objects get registered in the IoC container, versus what gets created "in-line" as a concrete reference, via the new
keyword ?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with softwareengineering.stackexchange