Why data layer has a dependency on the domain layer?
Author: ghostCreated Mar 31, 2016Updated Feb 19, 2022
Labelsquestiondiscussion
As stated in Clean Architecture, dependencies should point only inwards. This separates layers in a way that they could be interchangeable easily and also decoupled (right?). In your case, you decided to create 3 layers which have this dependency relationship:
presentation ---> domain ---> data
You use DI for some good reasons (still decoupling, dependency inversion ecc). However from your build.gradle files, it seems that data has a dependency on domain, while domain doesn't have anything. The dependency is in this way:
presentation ---> domain <--- data
Could you explain me why? Is there something I'm missing?
Source: android10/Android-CleanArchitecture