How To Add Dependency Injection

Dependency Injection, why do you need it? You start your new app with good intentions. You strive to keep the code clean but quickly things go wrong. You hook your app to a set of services, add analytics, add some logging. Quickly you find there are dependencies all over your app. It is almost impossible to run automated tests against your app. Difficult to reproduce strange behaviour users are reporting out in the wild. It might be time for Dependency Injection.

Depend on abstractions. Do not depend on concrete classes

Read more