Both have its pros and cons.

The first normal approach where a class could perform it’s own injection and access to the subcomponent provided injection.

The reverse approach is more for encapsulation, where it hides the subcomponent from the external world, while the dependencies could still be injected to the component. This is used in AndroidInjector as you mentioned, so it totally hidden the dependencies from it’s actual target class.

Written by

Passionate about learning, and sharing mobile development and others https://twitter.com/elye_project https://www.facebook.com/elye.proj

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store