1. Traditional MVC pattern
- Model (Model): data storage.
- View (View): user interface.
- Controller (Controller): business logic.
Model represents data storage, mainly used to achieve data persistence; View represents user interface (UI), mainly used to realize page display; Controller represents business logic, connecting View and Model in series
1. The popular MVVM pattern
- Model (Model): data storage.
- View (View): user interface.
- View Model (ViewModel): Two-way binding of data and interface.
MVVM removes the Controller in MVC and replaces it with ViewModel, which is a synchronized View and Model object. Its function is to operate DOM, and it is characterized by two-way data binding.