I'm trying to implement the MVP pattern into my project following the android blueprints guide. Currently, I am holding the User (entity data) within my Presenter, which I really dislike, because, on every configuration change, the presenter fetches the user from the database.
My first question is:
- Should I keep my data in the Repository (as I am using dagger 2 and the repository lives in the application scope) or should I keep it within the presenter and persist it there somehow. I would personally like to keep it in the presenter, however, I am trying to learn w/e the conventional way is.
I am also aware of android architecture components, ViewModel in particular, however, I would like to keep the MVP pattern instead of MVVM.
My second question is:
- After achieving persistence, how should I go about using LiveData with MVP?
I've been stuck on this problem for quite a while and would love to finally get through it.
Cheers