The arc90 lab is the playground of arc90 - a New York-based technology and strategic consulting firm. The lab is a place for us to share our ideas, tools and the occasional experiment in web technology. All ideas, experiments and tools are licensed under Creative Commons.

licensed under creative commons

This site is licensed under a Creative Commons Attribution 2.5 License.

Tools

Modular

If you've been beating your head against the wall trying to get Cairngorm and Modules to work together, stop now. We've already knocked ourselves senseless, not that we had much sense to begin with, and, flux capacitor like, come up with a solution.

What is this?

There's been a lot of talk about using Cairngorm with Flex's built in Module framework, and the general consensus is that it's just not worth the effort. Here at Arc90, we use Cairngorm extensively, and until recently, had not leveraged modules. Then we found ourselves faced with the dilemma of making Cairngorm and Modules play nice. It turns out that the solution was fairly simple, as well as lightweight: we call it Modular.

Modular makes use of some great ideas that have been floating around the Flex community for awhile:

The parent application utilizes the existing Cairngorm framework, while our modules leverage Cairngorm, supplemented by Modular.

How Do I Use It?

To use Modular in your Flex projects, just follow these simple steps:

Download The Code

Click on the icon below to download the source code:

Download

The file, modular.zip, contains a compiled library, the source, and ASDoc generated documentation.

Add the code to your Flex project

You can either add the compiled library, Modular.swc, to your project's library path, or include the source directly in your project.

Build your application by extending the classes contained in the com.arc90.modular package.

Any events that will be broadcast by the CairngormEventDispatcher should be instances of AbstractModuleEvent or a subclass:

Extend ModuleFrontController and add commands.

Extend ModuleSequenceCommand for any commands that will be chained:

Dispatch events

Use the dispatch() method of the AbstractModuleEvent class to dispatch your events.

or, use the CairngormEventDispatcherFactory.

Licensing

This arc90 tool is licensed under the Creative Commons Attribution 2.5 license.

Discuss Modular

You can offer feedback on Modular at the arc90 blog.

Digg Del.icio.us