<https://stackoverflow.com/q/65439079/2976366> It ...
# koin
t
https://stackoverflow.com/q/65439079/2976366 It would be nice if someone could give a solution to this since it is such a common question and architecture used in Android
2
e
Technically, the best solution I have been using for a long time is module isolation using Gradle. However the precondition is I never took that jetpack navigation lib. Let me give a short desc to see you like it. Basically, we have a pair gradle modules (let say they are all android-lib module) for each feature: • “featureA-api” which contains all exposed interface and data classes (may be some extra navigation files in your scenario I don’t know) • “featureA-impl” which contains all implementation as well as koin-module setups(should separate exposure dependencies and internal dependencies), and it depends on its “api” module and any other “api” modules like “B-api”“network-api” “uikit-api”, etc. Through this way, featureA can get access to any modules it wants once they have registered their exposure apis as dependencies in koin ecosystem. BUT feature A could not access B’s internal dependencies bc A doesn’t depend on B-impl gradle module, even B registered that to koin.