An Introduction to the MVVM pattern
The Model-View-ViewModel, or MVVM pattern as it’s commonly known, is a UI design pattern. It’s a member of a larger family of patterns collectively known as MV*, these include Model View Controller (MVC), Model View Presenter (MVP) and a number of others. Each of these patterns is concerned with separating UI logic from business logic in order to make applications easier to develop and test. To understand the MVVM pattern better, it helps to look back at its origins. MVC was the first UI design pattern, and its origins track back to the Smalltalk language of the 1970s . The image below illustrates the main components of the MVC pattern: This pattern separates the UI into the Model that represents the application state, the View, which in turn is composed of UI controls, and a Controller that handles user interactions and updates the model accordingly. One of the big problems with the MVC pattern is that it’s quite confusing. The concepts look ...