DynModules is a Flex 4 example that uses the Robotlegs AS3 micro-architecture framework and Joel Hooks version of the Robotlegs Modular Utility to communicate between modules that can be loaded dynamically. The example is loosely based on Joel Hooks great Modular Doodads application and on information from the Robotlegs Knowledge Base.
The DynModules example consists of a main application and selectable modules for input (sliders or form) and for output (pie chart or column chart). By loading the input and output modules at runtime, the appearance of the application can easily be made device or user specific (e.g. slider inputs for a touch-enabled device, an extended form for an administrator).
The modules and main application are wired together by Robotlegs and the Modular Utility using automated, metadata based Dependency Injection. Not only does this greatly reduce the amount of code needed, it also structures the application and makes alterations much easier.
To fully take advantage of the modular approach, Runtime Shared Libraries (RSLs) were used to reduce application size. The main DynModules application is only 60 KB and the average module size is 90 KB.
About the DynModules example:
Default both runtime modules In 1 and Out 1 are loaded at startup. When loading has finished, values (default: 2, 4, 6) are injected in the modules from the model in the main application. The SeriesInterpolate effect is used to add smooth transitions to the charts.
Compiled with: Flex_sdk_126.96.36.19976, Robotlegs v.1.3.0 , robotlegs-utilities-modular (version 2010/06/06)
The source code for the example can be found on github (includes ASDocs compatible comments).