Moudlar RL

goliatone's Avatar


28 Aug, 2011 02:30 PM

Hi everybody,
I've been wrapping my head around RL and now I'm digging into the Modular aspect of it- which is in fact my main reason to use RL at this point.

First thing I've done is read- a few times- the Best Practices guide on github. Followed some tutorials on regular context set ups and been looking around now for examples on Modular.

I have to say that it is a bit of a dark area compared with other aspects of the framework. The fact that there are different forks of the utility and the examples you find around are pretty basic or confusing (AcmeWidgetFactory, I'm looking at you) makes it a bit of a drag to move on.

As I understand it simplistically, a modular approach is nothing more than different context's open for communication among them through a shared main eventdispatcher. I like this, it makes it simple and straight forward to grasp compared with other solutions I've seen before (pmvc's pipes)

Now, my concern at this point is mainly related with how to declare modules dynamically.
The way I understand it:
a) Each module has a contextView or main view which is where we create the modules context through the parentInjector setter. (Analogous to a <local:MainContext contextView="{this}"/> entry point in a single context flex example)
b) Since that setter is being injected, when we honor that dependency our context will be created.
c) We want to have that injected as soon as we add that view to the display list.
d) For that injection to be resolved, be need to have previously introduced our view to the injection layer.
e) I would use viewMap to register my modules' contextView

Now, doubts:
I've seen recommendations about mainly using mediatorMap and that mixing viewMap and mediatorMap come with a performance hit. I am not comfortable with RL as to fully measure that performance hit. Would you care to explain it to me?

I've also seen comments on how the application's main contextView and the main mediator should be mapped last. Why is that and what could go wrong?

Let's say I use a batch bootstrap command and If I want to conditionally load my modules at runtime, should I have one command mapping all modules' contextView and then on a next one map the app's mediator? What would happen if I latter need to add/map a module after the fact?

I am trying stuff, so perhaps I will end up finding out most of the answers my self, but I much rather for that not to happen midway through the project.


  1. 1 Posted by Siddharth on 27 Sep, 2011 10:35 AM

    Siddharth's Avatar

    Hey i am having some trouble with loading flex modules via ModuleManager and using the viewMap in the Context... If I use the viewMap for a Module, then I am unable to do "IModuleInfo" factory.create of the Flex Module once its loaded... I am unable to see the module added... Have you faced this issue ?

  2. 2 Posted by Siddharth on 27 Sep, 2011 11:09 AM

    Siddharth's Avatar

    Hey Srry! ... Figured out the problem! a little oversight as I was doing viewMap.mapType to the Module Class, whereas I should have been doing that to an interface that the module implements !


  3. Ondina D.F. closed this discussion on 02 Nov, 2011 05:50 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac