android10 / Android-CleanArchitecture

This is a sample app that is part of a series of blog posts I have written about how to architect an android application using Uncle Bob's clean architecture approach.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is data layer defined as "android library" plugin?

urosjarc opened this issue · comments

I'm confused with the fact that you are using "android library" in data layer because the data layer should not know what is happening on the presentation layer...

Why is it so? Did I miss something?

@urosjarc It does not matter what frameworks or libraries you use in the data layer... you can use what ever you want. What matters is that there is a clear abstraction between what's happening in the data layer and the presentation layer using interfaces. Those interfaces hide the details of what is happening in the data layer. But in this particular case the data layer must use the android library, because it's using Sqlite or shared preferences (I can't remember what one) to do it's data management. What you would not want to do is allow your presentation layer to talk directly to your data layer... or have your data layer talk directly to your presentation layer... also you would not want your data layer to directly effect your UI. I hope that makes sense.

Thanx for the explanation.