The application I'm using RL on is a modular Air app. Not modules in
the Flex sense - just in the 'separately compiled and loaded at
Each module will have it's own context and so on, but I was thinking
about creating a top level version that essentially replicates the
existing RL structure and flow, but with the view classes replaced by
a ModuleMediator - Module pairing. I think all the classes would stay
as-is except that view / module swap.
I have been playing with Robert's As3 Signals stuff as well, but there
are obvious advantages to the existing RL decoupling approach for
modules that don't have a clue about each other.
What I was thinking of was:
1. All inter-module data goes via strongly typed Data Transfer Objects
which have property accessors but no functionality.
2. Those DTOs are required parameters of strongly typed events - the
event classes would be dictated by the DTO required.
3. Inject the (strongly typed) events into the Commands wired to them.
4. Command.execute passes the DTO to the modules that need them as it
runs their API functions...
So - what are the advantages / disadvantages to passing those DTOs via
parameters in functions / Injecting them?
I'm guessing that passing by parameter makes my unit testing easier...
but I wondered whether I should be Injecting them instead?
Obviously I'd also like to create the ModuleMediator classes
spontaneously as required...
My app actually looks like DumbAirShellThatJustVerifiesModules ->
ModuleManager -> Modules. The dumb air shell can't be updated, but the
moduleManager that would contain this context / logic / super event
bus can be, so API changes in the modules can be handled that way.
I'm still fighting TextMate to get output from git when the RL bundle
does its thing, so this is a few days away, but does it sound like a
sensible approach? I saw a module demo but it's flex modules I think,
which is a bit different.