1.

Why Is Dependency Injection Useful?

Answer»

Different collaborators for different environments can be injected - test, production, test-database, REAL database. This allows classes to be tested INDEPENDENT of its collaborators (MAKES it easy to pass in stub or MOCK objects).

Different collaborators for different environments can be injected - test, production, test-database, real database. This allows classes to be tested independent of its collaborators (makes it easy to pass in stub or mock objects).



Discussion

No Comment Found