当前位置:网站首页>The difference between MVC and MVP
The difference between MVC and MVP
2022-08-09 00:05:00 【Agarwood】
The difference between MVC and MVP
As a new mode, MVP and MVC have a major difference: in MVP, View does not directly use Model, the communication between them is carried out through Presenter (Controller in MVC), and all interactionsIt all happens inside the Presenter, while in MVC the View will read data directly from the Model rather than through the Controller.
In MVC, View can directly access Model!Therefore, the View will contain Model information, and inevitably some business logic.In the MVC model, the change of the Model is more concerned, and there are multiple different displays of the Model at the same time, that is, the View.So, in the MVC model, the Model does not depend on the View, but the View depends on the Model.Not only that, because some business logic is implemented in the View, it is difficult to change the View, at least those business logic cannot be reused.
Although the View in MVC does "can" access the Model, we do not recommend relying on the Model in the View, but instead require that all business logic be handled in the Controller as much as possible, and the View only interacts with the Controller.
Partly from the author: IT Xiaobai_
边栏推荐
猜你喜欢
随机推荐
SyntaxError line:3546,column:96577,SyntaxError: Unexpected token '...'. Expected a property name.
STP---生成树协议总结
第七章 数据管理技术的发展
mysql建表常用sql语句
蓝牙模块HC-08——连接
BGP第二天总结作业
gptp协议
vspm虚拟串口调试
移动web开发-插件&事件篇
LeetCode 0179. 最大数
C# this.Invoke()的作用与用法
nlp 评论分类实现总结
C#编写飞行棋游戏
第一章 数据库系统概述
MySQL基础知识
第七章 无线与移动网络
OSPF综合实验
第五章 数据库编程
js实现继承的几种方式
穿越派·派盘V3.14发版啦!