This concept consists of structuring the App in 4 separate modules:
- app: Android module that contains the Android Application component and all the framework specific configurations. It has visibility over all the other modules and defines the global dependency injection configurations.
- presentation: Android module that represents the presentation layer. It contains the Android UI framework components (Activities, Fragments, ViewModels...) and the related resources (e.g. images, strings...).
- domain: Android module that represents the domain layer. It contains Use Cases (platform-independent business logic) and Entities (platform-independent business models). Ideally this module would be a pure Kotlin library because it has to be platform-independent. However in this concept it has to be an Android module because it depends on the data module which is an Android module itself.
- data: Android module that represents the data layer. It contains Repositories and their corresponding interfaces, the data source Api implementations and the corresponding api-specific models.
The dependencies between the modules and the visibility among them is shown by the picture below (the app module is not shown as it has global visibility over the all project):
The data flow is shown by the picture below: