MVVM
MVVM was first introduced by John Gossman at Microsoft in 2005. It was created for UI development using the Windows Presentation Foundation (WPF) framework. Later it was adopted by other frameworks, such as the following:
- React
- Xamarin
- AngularJS
MVVM fundamentally retains the concepts of the Model and the View from the older models, MVC and MVP. However, it uses the View Model as an intermediary between the View and the Model. There is also a substantial preference for using declarative data binding to coding. The data-binding feature of MVVM supports the automatic synchronization between the View and the View Model.
The View Model
The View Model exposes data and commands that the view can bind to. The data binding allows an automatic two-way synchronization between the View and the View Model. In other words, updates from the View Model are reflected in the View automatically, and the View Model can react to user actions in the View. This reduces...