In multi-modularized project, we have module Featu...
# android-architecture
k
In multi-modularized project, we have module Feature1 and module Feature2. If Feature1 needs an information from Feature2, what should I expose from Feature2, a data module or domain module?
j
The perfect worlds, feature 1 should not depends on feature 2, but you can use another module as bridge, like common, datasource e make theses feature modules depends on core modules
👍 1
🙌 4
🙌🏽 1
a
There is some way to do that: 1. You can move the common code to the core module if these functionalities are needed by a few others feature modules. Core module can be accessible by any feature module 2. You can create a featuer2-api module and expose the public interface in this module. Then use the functionalities from the feaurte1 module by the api module inyterface 3. Use the Adapter pattern inside your main app module to provide functionalities from feature2 to feature1 module. App module can access any feature module.
👍 1
t
We use "shared" and "core" modules to address such problems