きっかけ Dagger2はAndroid Developersの Guide to App Architecture でも紹介されており そろそろAndroidエンジニアでDagger2やDIがわからないのはまずそうな気がしてきたので、調べてみました。 よく分からないところは対応する【補足メモ】を読んでみてください。ソースコードを載せているので、イメージしやすいかもしれません。 最近アップデートがあったAndroidとの関連(dagger.android)までは今回は触れることができていません。 Dagger初心者の自分が驚いたところを太字にしておきます。 ほぼ以下のドキュメントの意訳です。間違っているところはご指摘下さい。 User's Guide https://google.github.io/dagger/users-guide.html User's Guide Dagger2概