Difference: Controller in MVC has evolved into viewModel in MVVM. MVVM mainly solves the problems of reduced page rendering performance and slower loading speed 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. What is MVVM?
Under the MVVM framework, the view and the model cannot communicate directly. They can only interact through the ViewModel. It can monitor data changes and then notify the view to automatically update. When the user When operating a view, the VM can also monitor changes in the view and then notify the data to make corresponding changes. This actually realizes two-way binding of data. And V and VM can communicate.
Picture examples are as follows:
##Advantages of MVVM mode:
2. What is MVC?
MVC is one of the most widely used software architectures. Generally, MVC is divided into: Model (model), View (view), Controller (controller). This is mainly based on the purpose of layering to separate each other's responsibilities. View generally uses Controller to communicate with Model. Controller is the coordinator of Model and View, and View and Model are not directly connected. Basically it's a one-way contact. M and V refer to the same meaning as M and V in MVVM. C means Controller refers to the page business logic. MVC is one-way communication. That is, View and Model must be connected through Controller.3. The difference between mvc and mvvm:
The difference between MVC and MVVM is not that VM completely replaces C. The purpose of ViewModel is to abstract the business displayed in the Controller. Logic, rather than replacing the Controller, other view operation services should still be implemented in the Controller. In other words, MVVM implements the reuse of business logic components. - Controller in MVC evolves into ViewModel in MVVM-MVVM displays the view layer through data instead of node operations-MVVM mainly solves a large number of dom in MVC The operation reduces the page rendering performance, slows down the loading speed, and affects the user experience. For more related knowledge, please visit:PHP Chinese website!
The above is the detailed content of What is the difference between mvvm mode and mvc mode?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.
