id: 161 View:article
Tutorials  DI
Dagger Dependency Injection

An introduction to dependency injection for Android

You might have heard the term "dependency injection" before.

You might have even tried to Google it and stumbled upon a definition that introduced 2 new unknown terms: inversion of control and dependency injection pattern.

Personally, I find the following definition to be the most descriptive - dependency injection for five-year-olds: 

When you go and get things out of the refrigerator for yourself, you can cause problems. You might leave the door open, you might get something Mommy or Daddy doesn’t want you to have. You might even be looking for something we don’t even have or which has expired. What you should be doing is stating a need, "I need something to drink with lunch," and then we will make sure you have something when you sit down to eat.

- StackOverflow answer

Full article