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 to follow MVVM architecture #7

Closed
kvizcarra opened this issue Sep 1, 2017 · 0 comments
Closed

Refactor to follow MVVM architecture #7

kvizcarra opened this issue Sep 1, 2017 · 0 comments
Milestone

Comments

@kvizcarra
Copy link
Owner

Refactor the project to follow the MVVM architecture pattern. This reorganizing will be important for unit testing in a future issue.

View

  • Activity
  • Fragment

ViewModel

  • Android Architecture ViewModel

Model

  • Repository
  • Android Architecture Room and DAO

The View should observe LiveData returned from the ViewModel for any data changes. The ViewModel will expose CRUD methods for any class, in this case the View, to call. The ViewModel will relay CRUD calls to a repository in the Model layer. The repository talks to Room through DAOs and returns LiveData.

Interfaces should be used for communication between classes.

@kvizcarra kvizcarra added this to the Version 1.0 milestone Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant