Architecture-samples: [todo-mvp-dagger] - Setting Modules and Fragments for all Activities/Fragment

Created on 20 Jun 2017  路  1Comment  路  Source: android/architecture-samples

Hi,

Is there any reason for using a module and a component for every activity/fragment?

One explanation would be to prevent unintended usage of some classes, but does it worth it?

Thank you

Most helpful comment

As an app grows it is nice to have the separation of dependencies for each UI elemnent. We are currently migrating to the new Dagger-Android constructs which will auto generate the subcomponents for each activity and fragment. While you may not need it in every app, we wanted to show what a setup looks like that has a separate module for each activity. Feel free to share an ActivityModule or a FragmentModule between many activities or fragments if you are not managing many dependencies that differ.

>All comments

As an app grows it is nice to have the separation of dependencies for each UI elemnent. We are currently migrating to the new Dagger-Android constructs which will auto generate the subcomponents for each activity and fragment. While you may not need it in every app, we wanted to show what a setup looks like that has a separate module for each activity. Feel free to share an ActivityModule or a FragmentModule between many activities or fragments if you are not managing many dependencies that differ.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BeQuietLee picture BeQuietLee  路  3Comments

ghost picture ghost  路  3Comments

DharitParmar picture DharitParmar  路  6Comments

jchesterisidoro picture jchesterisidoro  路  3Comments

ialmetwally picture ialmetwally  路  5Comments