Hi guys, I am using a multi-module architecture, w...
# android-architecture
j
Hi guys, I am using a multi-module architecture, where each feature consists of: •
:feat:A:implementation
:feat:A:api
• lower level module such as:
libraries:network
,
libraries:some-other-util
modules. The idea is well-known, where implementation modules depend on api modules and api module can only depend on lower level modules. I have now a situation, where
:feat:A:api
needs to reuse a class in
:feat:B:api
, therefore requiring
:feat:A:api
to depend on
:feat:B:api
, I would like to avoid this, as it couples feature A with feature B. What could be a solution to this type of problem? Should I introduce another lower level module like
libraries:common-models
? It feels not right to me. Should I try to refactor my API modules to avoid such dependency? Any suggestions are appreciated, thanks!
a
If you sure that apiA needs apiB and viceversa then creating a common module between those features is way to go i guess.
👍 1
j
My suggestion is avoid creating excessive modules. Every project is different, but I am working in a project with excessive modularization and I'm trying to modularize by feature instead of having modules for every single api. It is up to you to decide, but I never understood the real benefit of doing this modularization, just to compile 200 ms faster