当前位置:网站首页>[Software Architecture Mode] The difference between MVVM mode and MVC mode
[Software Architecture Mode] The difference between MVVM mode and MVC mode
2022-08-01 09:32:00 【Pig is not stupid】
First, MVVM mode:
1.MVVM composition
MVVM consists of three parts: Model, View and ViewMode:
- Model: The model.The data model, which is used to operate on the data.
- View: The view. Represents UI components, which are used to convert model data into UI for display.
- ViewModel: View-Model. Used to synchronize Model and View.
Under the MWVM architecture, there is no direct connection between the View and the Model, but through the ViewModel. The interaction between the Model and the ViewModel is bidirectional, so the changes of the View data will be synchronized to the Model, and the ModelChanges in data will also be immediately reflected on the View.
ViewModel connects the View layer and the Mode layer through two-way data binding, and the synchronization between View and Model is completely automatic without human intervention, so developers only need to focus on business logic and do not need manual operationsDOM does not need to pay attention to the synchronization of data state, and complex data state maintenance is completely managed by MVVM.
2.MVVC pattern diagram
Second, the MVC pattern
1.MVC composition
MVC consists of three parts: Model, View, and Controller:
- Model: The model.The data model, which is used to operate on the data.
- View: The view. Represents UI components, which are used to convert model data into UI for display.
- Controller: The controller. For business logic processing, the Controller obtains data through the Model, and after processing, renders the data through the View.
Note: MVC mode is less efficient than MVVM mode, because MVC mode lacks ViewModel and will not automatically synchronize, developers need to constantly interfere in the development process.
边栏推荐
- 指针的介绍及应用
- Redis middleware (from building to refuse pit)
- Go-Excelize API源码阅读(八)——GroupSheets(sheets []string)、UngroupSheets()
- How to query database configuration parameters in GBase 8c, such as datestyle
- Shell: Conditional test action
- experiment....
- 热修复技术可谓是百花齐放
- ogg同步oracle到mysql,字段里面可能有需要转义的字符,怎么配置转义?
- Redis中间件(从搭建到弃坑)
- 最新的Cesium和Three的整合方法(附完整代码)
猜你喜欢
随机推荐
改版去不图床 Token 的获取
JVM 运行时数据区与JMM 内存模型详解
mysql在cmd的登录及数据库与表的基本操作
How to get page data
正则表达式符号
Redis middleware (from building to refuse pit)
ogg同步oracle到mysql,字段里面可能有需要转义的字符,怎么配置转义?
leetcode-6134:找到离给定两个节点最近的节点
372. 超级次方
HoloView -- Tabular Datasets
毕业论文写作技巧
自定义IP在PCIE中使用
notes....
YOLOv7-Pose尝鲜,基于YOLOv7的关键点模型测评
leetcode-6132:使数组中所有元素都等于零
Microsoft Azure & NVIDIA IoT developers season I | Azure IoT & NVIDIA Jetson development foundation
基于MySql,Redis,Mq,ES的高可用方案解析
Explain / Desc 执行计划分析
Mysql数据库的部署以及初始化步骤
将Servlet项目改为SSM项目