android-clean-architecture-boilerplate icon indicating copy to clipboard operation
android-clean-architecture-boilerplate copied to clipboard

Will the presentation models always be useless?

Open JavierSegoviaCordoba opened this issue 5 years ago • 2 comments
trafficstars

Hello there. I was thinking after seeing a lot of repositories that usually the presenter or viewModel maps the domain models to presentation (there are no UI models) but this has a lot of problems (I shouldn't reference any platform resource, jetpack compose, etc). Even thinking in multiplatform this can be a huge problem.

Then I found this repo where I can see that the UI is separated from presentation so this problem is solved. But then I thought that really the presentation models will be the same than domain models.

Why should I keep the presentation models instead of using domain models directly until I reach the UI layer?

JavierSegoviaCordoba avatar Mar 08 '20 01:03 JavierSegoviaCordoba

KISS .. keep it simple. IF you dont need those extra models, you can use the models from te domain without problems. In some cases . probably you would need a diferent object to load data in your view, because you have an adapter in your recyclerview, that is a case where you can create your own model inside of the presentation layer .

mr-gilberto avatar Mar 10 '20 06:03 mr-gilberto

Yeah but you can use the UI models, I was talking about the presenter models. @mr-gil

JavierSegoviaCordoba avatar Mar 10 '20 08:03 JavierSegoviaCordoba