How do Application Tiers Communicate in Robotlegs

本文介绍了Robotlegs框架中如何利用自定义的Flash事件来进行不同组件间的通信,包括Mediators、Models和Commands之间的交互方式,强调了自定义事件的灵活性及避免在Models和服务中直接处理事件的重要性。

Robotlegs uses native flash events for communication between framework actors. Custom events are typically utilized for this purpose, it is however possible to use existing Flash events for this same purpose. Robotlegs does not support Event bubbling, as it does not depend on the Flash display list as an event bus. Utilizing custom events allows developers to add properties to the Event that can be used as strongly typed payloads for system events between framework actors.

Events are sent from all framework actors: Mediators, Models, and Commands. Mediators are the only actors that receive framework events. Commands are triggered in response to framework events. An event can be both received by a Mediator as well as trigger a command.

Models and Services to not listen for or respond to events. Doing so would tightly couple them to application specific logic and reduce the potential for portability and reuse.

Robotlegs框架使用flash自带事件机制进行通信,自定义的事件也是利用的flash事件机制,目的与flash自带事件一样。Robotlegs不支持事件冒泡,所以不依赖于Flash显示列表。自定义事件允许开发者添加一个强类型的事件属性。

Mediators、Models、Commands可以发送事件。只有Mediators接收框架事件。

2011041610554819.jpg

转载于:https://www.cnblogs.com/ywxgod/archive/2011/04/16/2017868.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值