re: What is Dependency Injection? VIEW POST

FULL DISCUSSION
 

The core of dependency injection, the reason we do it at all, is to make a static map of service objects.

While this is nice, it's really not the core of dependency injection. The reason why you want to do dependency injection at all is:

  • To help make code testable
  • Separate our concerns
  • Allow our code to be re-used

Take a look at

especially at the end.

code of conduct - report abuse