android10 / android10/Android-CleanArchitecture-Kotlin

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

Abierto
#11 6 comentarios 0 reacciones 0 asignados Ver en GitHub
discussion question
Lenguaje dominante
Kotlin
Estrellas
4.8k
Forks
929
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.