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

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

问题描述

MVP模式中的控制器与MVP模式中的演示者有什么区别?您能否提供链接了解他们的优点和使用情况?

解决方案


在MVP中,演示者承担中间人的功能(由应用程序控制器在MVC中)。此外,View负责处理以前是Controller的工作的UI事件(如mouseDown,keyDown等)。最终,该模型严格地是域模型。


维基百科



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



另见Martin Fowler的模型视图演示者退休说明


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?

解决方案

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.

Says Wikipedia.

Here is a more detailed explanation on the differences between the two.

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

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

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