MVC and MVVM frameworks

MVC

1.View: Responsible for rendering the user interface, should avoid involving business logic in the View 2.Controller: Responsible
for receiving user input, calling Model logic according to user input, handing the generated results to the View part, and letting the View render the necessary output.
3.Model: Responsible for managing data, most of the business logic should also be placed in the Model

Disadvantages: Due to the phenomenon that the View and Model do not communicate with the Controller during the implementation process, resulting in data confusion and difficulty in maintaining and adding functions
write picture description here

MVVC

The components Model, View, and ViewModel
establish the binding between the data and the view, simplify the front-end code
view: UI interface
ViewModel: It is the abstraction of the View, responsible for the information conversion between the View and the Model, and transmits the Command of the View to the Model
Model : data access layer
write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324794652&siteId=291194637