Skip to main content

Posts

Showing posts from December, 2020

MVVM Android Example

  What is MVVM? For a start, let's consider the classical description of this template and analyze each of its components.  Model-View-ViewModel  (ie  MVVM ) is a template of a client application architecture, proposed by John Gossman as an alternative to MVC and MVP patterns when using Data Binding technology. Its concept is to separate  data presentation logic  from  business logic  by moving it into particular class for a clear distinction. So, what does each of the three parts in the title mean? Model is the logic associated with the application data. In other words, it is POJO, API processing classes, a database, and so on. View is actually a layout of the screen, which houses all the widgets for displaying information. ViewModel is an object which describes the behavior of View logic depending on the result of Model work. You can call it  a behavior model of View . It can be a rich text formatting as well as a component visibility contr...