`
me-
  • 浏览: 69002 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

flex puremvc小笔记。

    博客分类:
  • flex
 
阅读更多

1.在application 里面注册 mainFacade:MainControl,mainFacade里注册一些命令(command)。

1.5 mainFacade.startUp(this); 用来做什么?

分两类一类是proxy,还有一个主mediator

			this.facade.registerProxy(new LoginProxy());
			this.facade.registerProxy(new RoleProxy());
			this.facade.registerProxy(new LogoutProxy());
			
			this.facade.registerMediator(new SoftPosMediator(notification.getBody() as TcSoftPosOnline));

 因为以后其他的madiator就由这个主mediator注册了。

mediator用来做逻辑,原则上,一个页面的所有逻辑都应该对应的一个mediator里。
proxy就是来做一些物理的,比如新建一个httpservice,并设置服务器端对应的路径,端口,参数包装等。

command做包装,command可能指挥对应的proxy去做发远端请求,和监听返回并做处理的事情。

2.application中可以使用mainFacade来做逻辑,如mainFacade.sendNotifacation(command)。

3.1监听这个命令的Mediator,执行命令。

3.2这边继续做其他逻辑。

mainFacade.sendNotification(PropertyCollect.VIEWTO_LOGIN);

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics