MVC 模式中的控制器和 MVP 模式中的演示者有什么区别? [英] What is the difference between controller in MVC pattern and presenter in MVP pattern?

查看:25
本文介绍了MVC 模式中的控制器和 MVP 模式中的演示者有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MVC 模式中的控制器和 MVP 模式中的演示者有什么区别?您能否提供链接以了解它们的优点和使用场景?

What is the difference between controller in MVC pattern and presenter in MVP pattern? Can you provide links for understanding the Merits and usage scenario for both of them?

推荐答案

在 MVP 中,Presenter 承担中间人"的功能.(由 MVC 中的应用程序控制器播放).此外,View 负责处理 UI 事件(如 mouseDown、keyDown 等),这曾经是 Controller 的工作.最终,模型变成了严格的领域模型.

In MVP the Presenter assumes the functionality of the "middle-man" (played by the Application Controller in MVC). Additionally, the View is responsible for handling the UI events (like mouseDown, keyDown, etc), which used to be the Controller's job. Eventually, the Model becomes strictly a Domain Model.

维基百科.

这是一个 更详细地解释两者之间的差异.

另请参阅 Martin Fowler 的模型视图演示者的退休说明.

See also Martin Fowler's Retirement note for Model View Presenter.

这篇关于MVC 模式中的控制器和 MVP 模式中的演示者有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆