Lilly
12/29/2020, 10:29 AMJavier
12/29/2020, 10:30 AMLilly
12/29/2020, 10:33 AMJavier
12/29/2020, 10:43 AMLilly
12/29/2020, 10:48 AMMarko Novakovic
12/29/2020, 10:51 AMdomain
knows only about itself, it knows nothing about data
nor app
so you shouldn't even try to do anything with app
models inside domain
layer. app
layer can map to domain
and vice versaclean architecture
as we use it on Android. do not have 3 layers: domain
, data
, and presentation
. that's fine for small apps but for slightly bigger ones that's not good. that practice goes against core principles that clean architecture
stands for -> change
you should have domain
, data
, and presentation
layer PER feature but not for the whole app.
main problem with having these three layers across whole app is that when you want to add something, api call for example, you have to change all three layers -> add method call inside domain
, implement it inside data
and call it from presentation
so every change calls for changes in every module which is not goodLilly
12/29/2020, 10:58 AMvice versa? Than domain would be aware of applayer can map toapp
and vice versadomain
you should haveThats what I have. Layers are implementation details. Anyway I still don't know how to map from domain to app?,domain
, anddata
layer PER feature but not for the whole app.presentation
Marko Novakovic
12/29/2020, 10:59 AMViewModel
calls UseCase
which only forwards call to Repository
which just forwards call to API Service
and none of these actually does anything to the data, just passing it around. everything could be avoided with ViewModel
calling API
directlyLilly
12/29/2020, 11:03 AMMarko Novakovic
12/29/2020, 11:04 AMdomain
model into app
module and map it inside app
. domain
should not work with domain
nor data
modelsLilly
12/29/2020, 11:08 AMMarko Novakovic
12/29/2020, 11:10 AMLilly
12/29/2020, 11:19 AMclean architecture
samples out thereJavier
12/29/2020, 11:20 AMMarko Novakovic
12/29/2020, 11:24 AMLilly
12/29/2020, 11:50 AMapp -> domain -> data is wrongapp -> domain -> data is the data flow not the flow of dependency rule :)
Marko Novakovic
12/29/2020, 11:58 AMursus
12/30/2020, 8:43 AMJoost Klitsie
01/05/2021, 7:48 AMMarko Novakovic
01/05/2021, 7:54 AMLilly
01/10/2021, 3:01 AM