当前位置:网站首页>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_
边栏推荐
猜你喜欢
随机推荐
关于如何求两个字符串的最大公共子串的问题
2020-10-17
移动web开发-插件&事件篇
MySQL导入导出数据库
OSPF综合实验
一个电压跟随器的小故事
snmp获取agent OID,及MibBrowser使用
遇到一个STM32中断的坑,记录一下(和NVIC的抢占位设置有关)
MVC和MVVM
APUE---chap4文件和目录---4.2~4.18(stat/access/umask/chmod/remove/rename)
SyntaxError line:3546,column:96577,SyntaxError: Unexpected token '...'. Expected a property name.
Laravel框架之文件上传
Win10安装 pycocotools
C#编写飞行棋游戏
BGP总结
vspm虚拟串口调试
js实现继承的几种方式
一 C#中通过USB操作手机文件
第六章 数据库安全与保护
HCIP2--HCIA复习