flex puremvc小笔记。

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);

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值