Square Inc. has presented it's internal modular architecture at Droidcon SF'19:
https://www.droidcon.com/media-detail?video=380843878
However, I'm a bit confused with some bullets. Could you please help me?
- Why do they actually need
:wiring
modules? I find it adding complexity:
you get extra gradle module for each new feature
you have to make a sort of global injection into your Fragments somewhere in
:app
, because Fragments defined in:impl
modules cannot access it's DaggerComponent, which is defined in:impl-wiring
modules.:impl
doesn't depend on:impl-wiring
, because the dependency is reversed.you cannot have an Android Dynamic Feature modules, because they should know about it's DaggerComponent in order to inject it's Fragment. But there is no way to do such injection from
:app
module, which is base-module for Dynamic Features.
so why :wiring
modules at all?
One can merge :impl
and :impl-wiring
, or :fake
and :fake-wiring
together to eliminate all the issues mentioned above. And also, in :demo-apps
one could just have a dependency on either :impl
or :fake``, and not on
:impl-wiring(or
:fake-wiring```).