English 中文(简体)
MVC:选择在业时间的观念
原标题:MVC: choosing a view at runtime

我对MVC设计赞助人说得很新,我把我所有旧的法典译出。

我想转向这种模式,因为我可以根据我的需求改变我的看法,但我觉得难以在常年这样做。

我发现了一个极好的例子。

<mx:ViewStack xmlns:mx="http://www.adobe.com/2006/mxml" resizeToContent="true" xmlns:views="MVC.views.*">
  <views:HomeView id="Home"/>
  <views:SecondPage id="SecondPage "/>
</mx:ViewStack>

如果我想改变(无论主计长说什么)一种观点,例如第二Page的观点?

(我明确指出了我的观点)

最佳回答

在灵活性方面,一般认为是良好做法,可以避免在你的控制层直接提及你的视力组成部分。 更新意见的最常见办法是数据具有约束力。 我认为,MATE是这方面的最佳灵活框架,因为它非常容易以松散的方式将数据注入意见。

然而,如果你实际上对持有选定物的变量具有约束力, 你们的观察指数,你将介绍知识引入你的模式,这也是不受欢迎的。 另一种解决办法是,在你看来,设立活动处理人,以应对在你申请时其他地方发生的事件,并更新自己。 MATE有你在事件图中可以使用的信号器,以显示对事件的看法。

问题回答

http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm” rel=“nofollow noretinger”>Cairngorm

除此以外,你还可以有一个模式,保持申请状况,并将选定的“观点索引”与申请挂钩。





相关问题
Disable button tooltip in AS3

I want to disable the tooltip on certain buttons. The tooltip manager seems to be an all or nothing solution. Is it possible to disable the tooltip for just one or two buttons?

Multiple Remote call made simultenously

I was making multiple remote calls and they are done sequentially and when I am getting a result event back it s triggering calls to all the methods with ResultEvent as an argument . I am supposed to ...

Attaching a property to an event in Flex/AS3

I have a parameter that needs to be passed along with an event. After unsuccessful attempts to place it on the type by extending the class, I ve been advised in another SO question to write a custom ...

Clearing RSL in Cache

I have built a flex application which has a "main" project and it is assosciated with a few RSL s which are loaded and cached once i run my "main" application. The problem i am facing is that the ...

What s a good way of deserializing data into mock objects?

I m writing a mock backend service for my flex application. Because I will likely need to add/edit/modify the mock data over time, I d prefer not to generate the data in code like this: var mockData =...

AS3 try/catch out of memory

I m loading a few huge images on my flex/as3 app, but I can t manage to catch the error when the flash player runs out of memory. Here is the what I was thinking might work (I use ???? because i dont ...

热门标签