-
Notifications
You must be signed in to change notification settings - Fork 0
Dagger β Some theory about component relationship
Devrath edited this page Oct 8, 2023
·
1 revision
Contents |
|---|
| How Consumer gets object references in Dagger |
| How Consumer gets object references in Dagger |
| Relationship between components |


- In a
daggerthere can be multiplecomponentsand theconsumermight have to get the objects from all the components - So whatever the requirements of the
consumer, Theconsumerrequests from correspondingcomponents. - The component finds the object(if exists) and provides it from
@Injectannotated constructor or from a@Module. - The
componentcould be defined at anapplication level,activity level, orfragment level.

- Now the
consumercan request in such a way that, Say consumer requests some object references from a fragment component, and the fragment component can request some object references from an application component. - Thus there can be a relationship between the components and thus a dependency.
- Now finally the fragment component will be the one that gives the references to the
consumer.