The difference between mvc and mvvm is: 1. The business processing modes are different. In MVC, View can directly access the Model, while MVVM is a mode that logically separates the page from the data. It puts the data binding work into Implement it in a JS; 2. The processing of data operations is different. MVVM displays the view layer through data rather than node operations.
What is the difference between mvc and mvvm:
The biggest difference between MVVM and MVC is: baiMVVM implements View and The automatic synchronization of the Model means that when the attributes of the Model change, we no longer need to manually operate the Dom element to change the display of the View. Instead, after changing the attribute, the display of the View layer corresponding to the attribute will automatically change. Very magical~
MVC, MVP, and MVVM are three common front-end architecture patterns (Architectural Pattern), which improve code organization by separating concerns. Different from Design Pattern, which is an abstract method summarized to solve a type of problem, an architectural pattern can often use multiple design patterns.
MVC mode is the basis of MVP and MVVM modes. These two modes are more like optimized and improved versions of MVC mode. The MVs of the three of them are Model and view are the same. The difference is the link between MVs. .
Extension content:
The full name of MVC is Model View Controller, which is model-view-control The abbreviation of controller is a software design paradigm that organizes code in a way that separates business logic, data, and interface display, and gathers business logic into a component to improve and personalize the interface and user interaction. , no need to rewrite business logic. MVC was uniquely developed to map traditional input, processing, and output functions into a logical graphical user interface structure.
MVVM is essentially an improved version of MVC. MVVM abstracts the state and behavior of the View, allowing us to separate the view UI and business logic. Of course, ViewModel has already done these things for us. It can take out the Model data and help handle the business logic involved in the View that needs to display content.
Microsoft's WPF brings new technical experiences, such as Silverlight, audio, video, 3D, animation..., which results in the software UI layer being more detailed and customizable. At the same time, at the technical level, WPF also brings new features such as Binding, Dependency Property, Routed Events, Command, DataTemplate, ControlTemplate and so on.
The origin of the MVVM (Model-View-ViewModel) framework is a new architectural framework that evolved from the application method of combining the MVP (Model-View-Presenter) mode with WPF. It is based on the original MVP framework and incorporates the new features of WPF to cope with increasingly complex changes in customer needs.
The above is the detailed content of What is the difference between mvc and mvvm. For more information, please follow other related articles on the PHP Chinese website!