Dagger 2 - Back to Basics
summary
Dagger 2 shifts dependency injection to compile-time by generating readable factories and providers via annotation processing. The talk walks through wiring a small Android app with modules, components and @Provides, shows that missing bindings fail at compile time, explains scopes as lifetimes (application, activity, user) including singletons, and covers testing tradeoffs and workarounds such as build-variant replacement with a working end-to-end example.
AI-written summary · about
chapters (15)
- 0:00Start
- 1:58Dependency Injection
- 2:43Why?
- 4:01Problems
- 5:24Requirements
- 7:42Summary
- 8:53Dagger 2
- 10:253 Forms of Injection
- 10:39Constructor Injection
- 11:16Field Injection
- 28:05Scope - Example
- 31:21Scope - Conclusion
- 34:24Tests - Dagger
- 34:58Unit Tests
- 35:48Functional Tests
related talks
38mDagger 2, 2 Years Later
25mDagger 2 Android : Defeat the Dahaka
30mPowering up Dagger for Less Code and Cleaner Architecture
48mDemystifying Dagger
41mA (K)night with Dagger - Slicing problems of newbies
29mForging the Dagger for the modern Android world
22mDependency Injection in Android using Dagger 2
27mUsing Dagger2 to Keep Android SDK Dependencies Clean
