Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: separate repo for each model #35

Open
AbdAllahAbdElFattah13 opened this issue Jul 30, 2022 · 1 comment
Open

Refactor: separate repo for each model #35

AbdAllahAbdElFattah13 opened this issue Jul 30, 2022 · 1 comment
Labels
good first issue 💡Suggestion💡 New idea to be implemented, improvments and updates

Comments

@AbdAllahAbdElFattah13
Copy link
Collaborator

AbdAllahAbdElFattah13 commented Jul 30, 2022

Usually, we have multiple repos in the app, each responsible for a model. So for example:

  • AuthRepo
  • UserRepo
  • RecipeRepo

Same can be done to the local/remote DS, or as well as the DAOs.

The main reason for this is simply better SRP.

Currently in the app, we have only one repo, I think this can refactored.

@ahmedeltaher ahmedeltaher added the 💡Suggestion💡 New idea to be implemented, improvments and updates label Jul 31, 2022
@AbdAllahAbdElFattah13
Copy link
Collaborator Author

Now we have the data repo interface is as followes:

interface DataRepositorySource { suspend fun requestRecipes(): Flow<Resource<Recipes>> suspend fun doLogin(loginRequest: LoginRequest): Flow<Resource<LoginResponse>> suspend fun addToFavourite(id: String): Flow<Resource<Boolean>> suspend fun removeFromFavourite(id: String): Flow<Resource<Boolean>> suspend fun isFavourite(id: String): Flow<Resource<Boolean>> }

I think we can easily break down into 3 separate repos:

  • AuthRepo
  • RecipesRepo
  • UserActionsRepo

I'm still thinking about the last two, should we merge them into one or keep them separate, so if anyone with any ideas please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue 💡Suggestion💡 New idea to be implemented, improvments and updates
Projects
None yet
Development

No branches or pull requests

2 participants