android10 / android10/Android-CleanArchitecture-Kotlin

Should a complex feature logic be placed in the datastore class or moved to the usecase class?

Aperta
#11 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
discussion question
Lingua principale
Kotlin
Stelle
4.8k
Fork
929
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi,
I'm working on the app which has a complex usecases which require multiple actions to be performed in order to usecase to be completed.

Lets, for example, say that I want to implement `File deletion feature` in my app such as Dropbox. This requires this app to firstly do a deletion of some file metadata from a database table and after it, to delete a file from the storage.

So far, we placed all of this logic to datastore class, but it just does not fill right for me, because I think there is no reason that datastore should know about file storage.

So, my question is what would be a better practice, to move this complex logic to `Use Case` class and there to sequentially execute calls to the `Repository` and `File storage` or to keep it in datastore class?

@android10, I'm looking forward to your opinion.
Best regards.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.