[Front-end] MVVM design pattern

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/cheidou123/article/details/91407098

1.MVC design patterns

mvc i.e., model-view-controller (Model - View - Controller)

  • model: application part of a data processing logic, typically used to model objects to the database operations such as memory access
  • view: the view portion, usually jsp, html, etc. to display part of the user
  • controller: controls the transmission data processing is typically used to service logic is responsible for attempting to read data from, and the model layer
    Here Insert Picture Description

2.MVVM design patterns

mvvm namely Model-View-ViewModel, design principles mvvm mvc is based, so that mvvm is not an innovation, at best, is a transformation, a little of which is the ViewModel innovation; as shown below:
Here Insert Picture Description
more As can be seen in FIG relationship among; ViewMode can be considered as a connecting bridge of the Model and view, Model view can be bound by an event, Model view can be bound by the data, and data can be realized by views fully ViewMode separation.
MVVM design pattern, no Presenter layer. Instead, V-Model level.
The V-Model does not require us to write, using MVVM design pattern encoding time, without paying attention to V-Model is how to achieve this level, it is completely built-Vue (Vue framework to achieve because it involves source, not explain)
before we develop through the MVP design pattern is for DOM development.
Using MVVM design pattern development time, data-oriented programming. Simplify the amount of code that is a great extent. This is a lot of code, almost all from the previous DOM manipulation.

Guess you like

Origin blog.csdn.net/cheidou123/article/details/91407098