I am trying to wrap my head around clean architecture but I am struggling with the concept of how to avoid some dependencies.
I am implementing an API in Java for personal use, however I was trying to find some examples and came across this post: https://android.jlelse.eu/a-complete-idiots-guide-to-clean-architecture-2422f428946f
I've checked out the project and was checking the implementation until one thing bothered me and that was on how objects get instantiated.
The data layer and domain layer both seemed pretty devoid of problems. Data and models are separated and use Interfaces to talk to one another. As of my understanding the data layer and presentation are both on the "outer rings", i.e. on a same level, but I thought they should be completely independent. However, in this project, in the presentation layer all instantiation from all necessary objects happen. they get passed it to the domain layer or even data layer. (this happens on the TownshipListActivity.java if you are curious)
This seems to me to make little sense. You would end up coupling your view with your data layer. Yes I agree that the domain layer is still wild and free, but is this correct?
Else where should these be created? In my application I started to play with the idea of having a context object that creates them all but somehow this also feels fishy to me...