运用PureMVC多核技术和Module构建系统

A basic PureMVC MultiCore AS3 example using Pipes Utility and Modules

June 21st, 2008

UPDATE [08/25/08]: Source has been updated using PureMVC 1.0.5 MultiCore.

These days I’ve been playing around with the latest cool utility for PureMVC MultiCore AS3 called “Pipes Utility” developed by Cliff Hall. It’s a very helpful and powerful utility to communicate among all core actors of a module based application using PureMVC.

For a better understanding I created a basic example using modules. It’s just a simple app called “HelloPipes”, which loads and unloads a module for communicating with its shell using Pipes. Module and shell are acting as a core based on PureMVC MultiCore AS3.

The following example including full source may help anybody who is interested in the new Pipe Utility too ;-) .

 

Example

Full source

HelloPipesSource.zip (Downloads: 1513 )

Tips using Modules, PureMVC MultiCore AS3 and Pipe Utility

  • Don’t import any classes of a PureMVC MultiCore module within the shell (main application) to avoid any issues at runtime loading and unloading a module. To define constants for using Pipes such as output and input pipe names, which are shared between shell and module, don’t use a reference to any actor. Use a simple “common” class instead, which stores only these constants for sharing by shell and module. Check the PipeAwareModuleConstants.as within the example above.
  • For communicating from shell to module and return without Pipes use well defined interfaces for the same reason mentioned before.
  • Clean up your module to avoid any issues loading and unloading it again. This may be helpfull for a successful garbage collection as well. Check out the code for the module within the example above, which uses an Interface called IPipeAwareModule. Using this interface the shell forces the cleaning up process of the module before the module will be unloaded.
  • Disconnect and unregister (if necessary) Pipes connecting shell and modules, when a module is unloaded.
  • Remove all PureMVC core actors of a module using facade.removeCore before a module is unloaded to avoid issues reloading it.
  • General issue: To reduce the file size of a module use the compiler option called load-externs. For detailed information check the Flex 3 Help: “Compiling modules - Reducing module size

Helpful links

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值