Skip to content

(MVVM) Model View View Model

Devrath edited this page May 30, 2021 · 10 revisions

Improvement from MVC, MVP to a better Architecture

  • To overcome the drawbacks of MVC, MVP architecture modifications were done to segregate it to a better representation of architecture called Model-View-ViewModel.
  • It is one of the very popular ways of structuring the android code.
  • MVVM helps you to separate your code into many layers that let you have your own responsibilities.
  • Code becomes more readable, testable, maintainable.
  • The codebase stands the test of time.
Contents
MVVM block diagram
MVVM + Repository Pattern block diagram
Using the android architecture component in MVVM

MVVM block diagram

MVVM + Repository Pattern block diagram

Using the android architecture component in MVVM

  • Why not - of course, yes.
  • Instead of the contract that exists between view and presenter, We can use a LiveData

Clone this wiki locally