什么是模型视图展示器? [英] What is Model View Presenter?

查看:30
本文介绍了什么是模型视图展示器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能以尽可能简单的方式解释什么是模型视图演示者模式?与模型视图控制器有什么区别?哪个最好或用于哪个目的?

Can someone please explain in a way as simple as possible what the Model View Presenter pattern is? What is the difference with Model View Controller ? Which is best or for which purpose ?

推荐答案

Martin Fowler 有一个关于 UI 设计模式的页面,他在其中定义并讨论了 MVC、MVP 和其他模式.

Martin Fowler has a page on UI design patterns, in which he defines and then talks about MVC, MVP and other patterns.

http://martinfowler.com/eaaDev/uiArchs.html

总结不同之处,MVC 中的 Controller 对 UI 有更多的控制和处理事件,而 MVP 中的 Presenter 更被动,只是通过 UI 呈现信息.

To summarise the differences, Controllers in the MVC have more control over the UI, and handle events, while a presenter in the MVP is more passive, and just presents information through the UI.

一般来说没有太大区别,而且它们之间的界限往往很模糊.

In general there's not much difference, and often the line between them is blurry.

这篇关于什么是模型视图展示器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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