The main content of this article is to describe the difference between MVC and MVVM. Interested friends can learn about it. I hope it will be helpful to you.
The main difference between them is that the Controller in MVC has evolved into the viewModel in MVVM. MVVM mainly solves the problems caused by a large number of DOM operations in MVC. When and Model change frequently in MVVM, developers need to actively update to View.
1. MVC (Model-View-Controller)
MVC is a relatively intuitive architectural pattern. User operation->View (responsible for receiving user input operations)->Controller (business Logical processing) ->Model (data persistence) ->View (feed back the results to View)
2. MVVM (Model-View-ViewModel)
MVVM takes the idea of "two-way binding of data model data" as its core, so there is no connection between View and Model. The interaction is through ViewModel, and the interaction between Model and ViewModel is two-way, so the view Changes in data will modify the data source at the same time, and changes in data source data will be immediately reflected on the View.
If you want to know more technical tutorials, please be sure to pay attention to PHP Chinese website!
The above is the detailed content of What is the difference between mvvm mode and mvc?. For more information, please follow other related articles on the PHP Chinese website!