Join G. Blake Meike for an in-depth discussion in this video @Subcomponents review, part of Android Dependency Injection with Dagger 2 and Kotlin.
- [Instructor] In the last video we created a subcomponent.…We've really kind of wandered…into Dagger's uncanny valley here though.…What we've got are automatically created factories…that depend on other automatically created factories…that use builders to assemble modules…that are also automatically created.…Good grief.…Let's go over this one more time.…Here's the code that injects the presenter…into the main activity.…
We've seen that inject method out there on the right before.…We should be pretty comfortable with that part.…But what's this App.rootFactory?…Well, App.rootFactory is an instance…of our new root factory.…Think of this as sort of a application level factory…whose main job is to provide other factories.…So where does the root factory come from?…Here's the definition of the root factory.…In a bigger, more complicated application,…the root factory might hold lots of information…that was global to the app.…
It might also provide lots of smaller factories.…In this tiny example, though, it only does two things.…
Author
Released
2/1/2019- Dagger basics
- Method and field injection
- Lazy and provider injection
- Dagger annotations: @Module, @Binds, @Provides, and @Named
- Multibinding
- Components and subcomponents
- Singletons and custom scope
Skill Level Intermediate
Duration
Views
Related Courses
-
Intermediate Kotlin for Android Developers
with Annyce Davis2h 8m Intermediate -
Android App Development: Data Persistence Libraries
with Annyce Davis4h 52m Intermediate -
Android App Development: RESTful Web Services
with David Gassner2h 49m Intermediate
-
Introduction
-
What you should know1m 37s
-
Using the exercise files1m 15s
-
1. Basics
-
What is Dagger?3m 53s
-
Why use Dagger?3m 44s
-
Setting up a Dagger project2m 46s
-
-
2. Essential Dagger
-
Method and field injection7m 13s
-
Lazy and provider injection4m 20s
-
3. Modules
-
Multibinding: Sets4m 42s
-
4. Components
-
@Components review2m 47s
-
@Component dependencies6m 53s
-
Introducing @Subcomponents4m 21s
-
@Subcomponents review3m 22s
-
-
5. Scope
-
Rethinking the graph1m 20s
-
@Singletons and @Reuseable3m 31s
-
Custom @Scope5m 13s
-
-
Conclusion
-
Next steps2m
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: @Subcomponents review