Dependency Injection in Android With Dagger2 (3)
Component as injector
In previous post, we replaced our Pure Dependency Injection with Dagger2. But, the conversion is without too much thoughts.
One improvement we can do is to follow Dagger’s convention of using Component as Injector.
We can make the following mental models:
- Dagger’s
@Module
is for creating objects. - Dagger’s
@Component
is for injecting objects into application classes.
Share this post
Twitter
Google+
Facebook
Reddit
LinkedIn
StumbleUpon
Email