Guowei Lv

1 minute read

Let’s look at the PresentationComponent more closely.

One strange thing is that PresentationModule has ActivityComponent as its dependency, and it @Provide all the objects provided by ActivityComponent already.

This is rather ugly, can we do something about it?

The answer is Component Dependencies.

The idea is that we can make PresentationComponent depends on ActivityComponent. That way, PresentationComponent automatically gets access to all the objects exposed by ActivityComponent.

After this change, it looks like this:

comments powered by Disqus