MVC模块化的GUI组件 [英] MVC modular GUI components

查看:105
本文介绍了MVC模块化的GUI组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想找到构建复杂的网页与MVC3和AJAX的方式。

I am trying to find the way to build complex web pages with MVC3 and AJAX.

我想用组件来实现这一目标。 每个组件包括了它自己的模型,视图和控制器。

I would like to use components to achieve this. Each component is consisted of it's own model, view and controller.

多个组件被放置在一些复杂的视图,并应共同采取行动, 提供期望的行为。

Multiple components are then placed on some complex view and should act together to provide desired behaviors.

在某些情况下,当用户执行某些操作(相互作用)与组分之一, 我必须通过AJAX更新页面的其他部分。 发生的动作(相互作用)有关组件,在它的实施方式中,不承担有关视图,并会被使用和什么页面的部分应该被更新,以及如何任何东西。

In some situations, when user performs some action (interaction) with one of the components, I must update other portions of the page via AJAX. Component on which action (interaction) occurred, in it's implementation, does not assume anything about view on which it will be used and what portions of the pages should be updated and how.

所以,当一些相互作用发生在一些组件,我需要一种机制(外部元件本身)将处理这种情况并更新页面的相应部分。 你将如何,通常,实施这样的机制?

So when some interaction occurs in some component, I need a mechanism (outside component itself) which will handle this situation and update appropriate parts of the page. How would you, generally, implement such mechanism?

推荐答案

我会使用调解模式,也有时会被误称为管理者模式

I would use the Mediator Pattern, also sometimes mistakenly referred to as the manager pattern.

这个类的调解组件的通信。

This class would mediate the communication of your components.

这篇关于MVC模块化的GUI组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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