Android App Clean Architecture: Should Data Layer Have Its Own Model Classes?
What´s the best approach when developing an Android app and trying to follow clean architecture guidelines (but not extremely strict - cause that may be overkill for smaller proje
Solution 1:
If I were you, I would go with the Image1 process. I think it is the job of your datasource to take whatever object is coming from your database or API or any endpoint you have and transform it into something easier to user in your repository.
Between Image1 and Image2, I think it depend of what data you want to store and what is the object you want to store. You may or may not need an ArticleEntity depending of your business rules. And if you don't need it, you don't have to create one.
But for some use case you may need to create that object to add some informations to your Article. For exemple, if you want to place in that a validity date or any other information that you will only use in your repository, you can go for Image2.
Post a Comment for "Android App Clean Architecture: Should Data Layer Have Its Own Model Classes?"