当前位置:网站首页>Analysis on the similarities and differences of MVC, MVP and mvvc
Analysis on the similarities and differences of MVC, MVP and mvvc
2022-06-13 04:42:00 【Dax1_】
MVC
- Model (Model): Save the data
- View (View): The user interface .
- controller (Controller): Business logic
communication mode :
Communication process :
- User pass UI Interface interaction trigger View Respond to ,View Send instructions to Controller
- Controller After completing the business logic , requirement Model Update data
- Model Send new data to View, requirement View to update , Users get feedback after the update
Typical frame :react
Be careful :MVC All communications are one-way
MVP
MVP Mode will MVC Of Controller Renamed Presenter
communication mode :
Be careful :
- The communication between each part is two-way Of
- View and Model No contact , All pass Presenter Pass on
- View Very thin , Don't deploy any business logic , be called " Passive view "(Passive View), That is, there is no initiative , and Presenter Very thick , All the logic is deployed there .
MVVM
MVVM Mode will Presenter Renamed as ViewModel( Model view ), Basically with MVP The pattern is exactly the same .
communication mode
The only difference is ,View and ViewModel Between Two way binding
Communication process :
- View Receive user interaction requests
- View Forward the request to ViewModel
- ViewModel operation Model Data update
- Model Update the data , notice ViewModel Data changes
- ViewModel to update View data
Typical frame :Vue、Angular
With Vue For example
- model: Corresponding data Data in
- v: Templates 、UI Interface
- VM:Vue Instance object
MVVM And MVC The biggest difference is MVVM Medium ViewModel The view is automatically updated
Reference documents
MVC,MVP and MVVM Icon - Ruan Yifeng's Weblog (ruanyifeng.com)
边栏推荐
- php开发博客系统的首页头部功能实现
- Ctfshow SQL injection (231-253)
- 【JS解决】leedcode 200. 岛屿数量
- PHP syntax
- ACM ICPC
- Implementation of homepage header function in PHP development blog system
- JS, how to add grid style
- Webpack system learning (VIII) how contenthash can prevent browsers from using cache files
- [LeetCode]-二分查找
- Nodejs parsing get request URL string
猜你喜欢
随机推荐
[JS solution] leedcode 200 Number of islands
Record a troubleshooting process - video call cannot be picked up
Redis master-slave replication, sentinel mode, cluster
使用Service Worker优选请求资源 - 持续更新
[chapter 67 of the flutter problem series] the solution to the problem that the get plug-in cannot jump to the route twice in the dialog pop-up window in flutter
Introduction to applet Basics (dark horse learning notes)
Trust programming - linked lists: use struct to implement linked lists, use heap to merge K ascending linked lists, and customize display
2022氯化工艺操作证考试题库及模拟考试
Cesium:cesiumlab makes image slices and loads slices
The processing flow of thread pool depends on the core parameters
2022 ICLR | CONTRASTIVE LEARNING OF IMAGE- AND STRUCTURE BASED REPRESENTATIONS IN DRUG DISCOVERY
Implementation of homepage header function in PHP development blog system
[sword finger offer] interview question 25 Merge two ordered linked lists
2022 ICML | Pocket2Mol: Efficient Molecular Sampling Based on 3D Protein Pockets
Ctfshow common postures (821-830)
你的一对一会议效率低下,你可以这么做!
Cesium:CesiumLab制作影像切片与切片加载
[try to hack] upload labs (temporarily write to 12)
[untitled]
Basic syntax example for go