Using Robotlegs in just one module

Daniel's Avatar

Daniel

30 Dec, 2013 10:43 PM

I'm developing a module that is loaded in a larger application and I want to use Robotlegs but in just my module. I can't seem to figure out the best place to create my context. Any advice?

  1. Support Staff 1 Posted by Ondina D.F. on 31 Dec, 2013 12:00 PM

    Ondina D.F.'s Avatar

    Hi Daniel,

    Any DisplayObjectContainer can be used as a ContextView. That means, you could create a context for every button, label, text input, etc, in your app, if you wanted to, but, of course, that wouldn't make much sense.

    The best place to create a "main" context is the root DisplayObjectContainer:

    • pure actionscript : the "Main" class extending a Sprite
    • Flex or AIR application : the application container, Application or WindowedApplication
    • Flex Module: The base class for MXML-based dynamically-loadable modules, Module

    With a Flex or AIR application the best place to create a context is in the handler of FlexEvent.PREINITIALIZE.

    With a Flex Module that is added to the stage of another application, you can create/instantiate the context in the handler of FlexEvent.CREATION_COMPLETE:

    private var _robotlegsContext: IContext;
    
    private function creationCompleteHandler(event:FlexEvent):void
    {
        _robotlegsContext = new Context()
            .install(MVCSBundle)
            .configure(SomeCustomConfig)
            .configure(new ContextView(this));
    }
    

    https://github.com/robotlegs/robotlegs-framework/blob/master/readme.md

    Does that answer your question?

    Ondina

  2. 2 Posted by Daniel on 08 Jan, 2014 09:13 PM

    Daniel's Avatar

    Thanks Ondina, but it doesn't seem to work in the application my module is being loaded in. My module never receives a CREATION_COMPLETE event. perhaps the larger application is loading my module in some special way.

    I was able to force the context creation by passing FlexGlobals.topLevelApplication (from an interface method that my module implements) however, this means that the RobotLegs ViewManager and StageCrawler are watching the entire application and not just my module. A couple questions on this sceario:

    Is it possible for me to specify the packages for mediation and injecting?

    If there was another RobotLegs module loaded to the application using my approach (context initialized with topLevelApplication), is there a problem with multiple contexts watching the topLevelApplication?

    Thank you!

  3. Support Staff 3 Posted by Ondina D.F. on 09 Jan, 2014 12:08 PM

    Ondina D.F.'s Avatar

    Hi Daniel,

    You're welcome!

    My module never receives a CREATION_COMPLETE event. perhaps the larger application is loading my module in some special way.

    In which way? Tell me more about how you load the module ( using a loader?), what kind of a module it is, what kind of an app it is (pure as3 , flex), where exactly do you create the context and how. Not receiving a CREATION_COMPLETE event is not normal. Does your module receive ADDED_TO_STAGE or, if it's a Flex Module, FlexEvent.PREINITIALIZE ?
    Actually, if you could attach a bare-bone project reproducing the issue, I could more easily find the issue. If you don't want others to see your project, we can mark the discussion as private until I download the attachment, then I'll delete it and mark the discussion as public again:)

    Using the topLevelApplication as the contextView for your module defeats the purpose of the modularity somehow. You should be able to define separate contexts, each with its own contextView. I'm sure there is something wrong with some settings or the way you load the module. Maybe it is something really trivial, but without more details it is hard for me to address all possible issues and scenarios.
    If it is not possible to attach a runnable app, then you should paste in here all relevant code.

    You were talking about ViewManager and StageCrawler. That means you're using robotlegs version 2, right?

    Ondina

  4. 4 Posted by Daniel on 10 Jan, 2014 07:19 PM

    Daniel's Avatar

    Unfortunately I don't know how my module is actually loaded since I only provide my module as a plugin to a larger application which I cannot have access to and yes, I'm using flex and robotlegs version 2. My dilemma is that users can bookmark and land at various portions of my application so I don't really have a 'main view' that the rest of my UI extends, rather, where my various view classes are added to the display list is not within my control.

    In the code below, none of my event listeners are called (I suppose they are swallowed) and only the 'set contextView' (no relation to RL) is called but the reference to 'this' is never added to the display list and cannot be used as RL context view. FYI: There is a proprietary injection framework in place but it is cumbersome and poorly documented so I prefer to use RL.

    ` < mx:Module
    xmlns:fx="http://ns.adobe.com/mxml/2009&quot; xmlns:s="library://ns.adobe.com/flex/spark&quot; xmlns:mx="library://ns.adobe.com/flex/mx&quot; creationComplete="onCC(event)" addedToStage="onA2S(event)" preinitialize="onPI(event)">

    fx:Script<![CDATA[ import mx.events.FlexEvent;

      /**
       * The module web context path.
       */
      public static var contextPath:String;
    
      /**
       * Reference the classes created dynamically, because they are
       * otherwise not included by the compiler.
       */
      private var _classes:ModuleClasses;
    
      /**
       * Injected by the extension framework when the module is loaded.
       */
      public function set contextPath(value:String):void {
          trace( 'injected by larger application' );
         contextPath = value;
      }
    
       protected function onCC(event:FlexEvent):void
       {
           trace( 'cc' );
       }
    
       protected function onA2S(event:Event):void
       {
            trace( 'a2s' );        
       }
    
       protected function onPI(event:FlexEvent):void
       {
            trace( 'pi' );         
       }
    

    ]]>/fx:Script < /mx:Module>
    `

  5. Support Staff 5 Posted by Ondina D.F. on 11 Jan, 2014 12:06 PM

    Ondina D.F.'s Avatar

    Hey Daniel,

    Concerning your question on package mapping, I've tried the following:

    private const PACKAGE_A:String = "yourdomain.modules.moduleA.views.components";
    ..
    var packageMatcher:PackageMatcher = new PackageMatcher();
    mediatorMap.mapMatcher(packageMatcher.require(PACKAGE_A)).toMediator(ModuleMediator);
    

    That works, but that's the first time I used PackageMatcher, and I'm not 100% sure it's o.k. Here, the PackageMatchingTest:

    https://github.com/robotlegs/robotlegs-framework/blob/master/test/r...

    https://github.com/robotlegs/robotlegs-framework/tree/master/src/ro...

    In the code below, none of my event listeners are called (I suppose they are swallowed)

    Hmm, that's strange. That means, to me, that your module is not added to the Stage of that larger application. And that means that your module wouldn't work even if you wouldn't use robotlegs. Isn't there any way to test your module against that application? Maybe the main application is adding a View from your Module, like this?

    var someonesModule = new SomeonesModule();
    addElement(someonesModule.someView);
    addElement(someonesModule.anotherView);

    That's a wild guess, of course!! But if it were like this, then you could create a robotlegs context for someView and another context for anotherView, and so on.

    My dilemma is that users can bookmark and land at various portions of my application so I don't really have a 'main view' that the rest of my UI extends, rather, where my various view classes are added to the display list is not within my control.

    Do those views communicate with each other, or can you treat them as isolated "modules" ?
    I'm sorry, but, obviously, I don't understand the use case.
    Maybe your solution of using the topLevelApplication as the contextView is the better one, but as you've noticed, ViewManager and StageCrawler would have a lot of work to do ;)

    Ondina

  6. Support Staff 6 Posted by Ondina D.F. on 11 Jan, 2014 12:13 PM

    Ondina D.F.'s Avatar

    Ah, forgot to add that in case you want to initialize a context manually, you can do it like so:
    https://github.com/robotlegs/robotlegs-framework/tree/master/src/ro...

  7. 7 Posted by Daniel on 15 Jan, 2014 08:13 PM

    Daniel's Avatar

    Thank you. Yes, your description of how the main application is using my module classes is probably correct and why those events are not raised.

    My views don't directly communicate with each other, but they do share the same services/models to fetch and pull data. If more than one view are in memory they will all be notified when new data arrives. I don't really need mediator mapping (since the 'host' application has its own required pattern) but I do want injection of singletons and mapping commands to events.

    Sounds like I will need to init the context manually and I don't want to complicate things with multiple contexts. So to just get injection of singletons and event/command mapping would I just use

    _context = new Context().install( EventDispatcherExtension, EventCommandMapExtension);

    What extension will fulfill dependency injection of singletons? Is this just something I declare in my configuration file?

    I think the best place to bootstrap is my model since all of my views fetch data which cause the model singleton to be instantiated. Would I init and configure my context there?

  8. Support Staff 8 Posted by Ondina D.F. on 16 Jan, 2014 03:04 PM

    Ondina D.F.'s Avatar

    I'm sorry Daniel, but I'm afraid I can't help you very much. The more I think about your scenario, the more I get stuck and can't see a good solution.

    So to just get injection of singletons and event/command mapping would I just use

    I would probably create the robotlegs context inside your Module after it is somehow added by the host app. Maybe calling another method from inside set contextPath?

    context = new Context()
        .install( EventDispatcherExtension, EventCommandMapExtension);
        .configure(SomeConfig)
        .initialize();
    

    SomeConfig (implements IConfig!!)

    public class SomeConfig implements IConfig
    {
    [Inject]
    public var context:IContext;
    
    [Inject]
    public var injector:IInjector;
    
    [Inject]
    public var commandMap:IEventCommandMap;
            
     [Inject]
    public var dispatcher:IEventDispatcher;
    
    public function configure():void
    {
        context.afterInitializing(afterInitializing);
        injector.map(SomeModel).asSingleton();
        commandMap.map(SomeEvent.TRIGGER_SOME_COMMAND, SomeEvent).toCommand(SomeCommand);
        commandMap.map(SomeEvent.TRIGGER_ANOTHER_COMMAND, SomeEvent).toCommand(AnotherCommand);
    }
    private function afterInitializing():void
    {
        dispatcher.dispatchEvent(new SomeEvent(SomeEvent.TRIGGER_SOME_COMMAND));
    }
    

    I would then inject an IEventDispatcher into SomeModel. Say, you inject SomeModel into SomeCommand, set someModel's property to some value, and someModel would dispatch an event to trigger AnotherCommand, etc. That would work. But how would you notify your views about the changes, without a Mediator or an IEventDispatcher injected into your views?

    I think the best place to bootstrap is my model since all of my views fetch data which cause the model singleton to be instantiated. Would I init and configure my context there?

    I wouldn't do that in a model!! How is the model singleton instantiated?

  9. 9 Posted by Daniel on 17 Jan, 2014 09:09 PM

    Daniel's Avatar

    What you describe is the direction I've been going in...

    But how would you notify your views about the changes, without a Mediator or an IEventDispatcher injected into your views?

    And this is the problem I'm having since I have no control over which, when, or where my views components land on stage. As discussed above, I could create a context for each view and I I just noticed that contexts can have children. So perhaps each of these contexts could be children of the main context created in 'set context', which is a method of my module called by the host application.

    I wouldn't do that in a model!! How is the model singleton instantiated?

    I know its bad form. My model is currently lazily instantiated on first access when any one of my view components lands on stage and requests data. I'd like to refactor using RL and map as a singleton.

    Thank you for helping me work through this.

  10. Support Staff 10 Posted by Ondina D.F. on 18 Jan, 2014 02:21 PM

    Ondina D.F.'s Avatar

    I've built a simple app where I've tried to mimic your scenario. I've managed to make it work, but I'm not sure if that is what you are after or if it's a good approach after all.

    Host application does something like this:

    var someModule:SomeModule = new SomeModule();
    someModule.someMethod();// in your example set contextPath or whatever
    

    SomeModule:

    public var someView:SomeView = new SomeView();
    public var anotherView:AnotherView = new AnotherView();
    
    private var context:IContext;
    
    public function someMethod ():void
    {
    var contextView:ContextView = new ContextView(this);
    context = new Context()
    .afterInitializing(afterInitializing)
    .install(MVCSBundle)
    .configure(SomeConfig, ModuleConnectorConfig)
    .configure(contextView)
    context.initialize();//force initialization, because SomeModule is not added to the stage
    }
    
    private function afterInitializing():void
    {
    someView.createContext(context.injector);
    anotherView.createContext(context.injector);
    }
    

    In SomeConfig, you map SomeModel, as I did in my previous post.
    ModuleConnectorConfig is configuring the modular communication.

    SomeView (similar for AnotherView)

    public function createContext(parentInjector:IInjector):void
    {
    context = new Context();
    ///////
    context.injector.parent = parentInjector;//!!!
    //////
    context.install(MVCSBundle);
    context.configure(MediatorsConfig, ModuleConnectorConfig);
    context.configure(new ContextView(this));
    }
    

    In MediatorsConfig SomeView is mapped to SomeMediator, and AnotherView to AnotherMediator.

    then, at some point, the host app adds the Views from someModule:

    addElement(someModule.someView);
    addElement(someModule.anotherView);

    SomeModel mapped in the "shell" context (SomeModule) is dispatching an event when its data changes, and the mediators are able to listen to it.

    The trick is to pass the parentInjector on to the sub-contexts, so the sub-contexts can inherit the mappings from the shell context.
    In my example, SomeView and AnotherView can communicate with each other and also with the shell (Model/Service), due to the ModularityExtension.

    If you don't know how to configure the modular events, tell me and I'll show you how. I made an example a while ago, that is not completely documented, but it could give you some ideas about the usage of the ModularityExtension.

    If you think that it would help you to see my classes that I mentioned above in this post, I could attach the app. I'd have to clean it up a bit, though ;)

  11. 11 Posted by Daniel on 21 Jan, 2014 09:43 PM

    Daniel's Avatar

    Thanks, its interesting to see your approach. I gave it a try, and I get an error thrown.

    My handful of 'base views' will have createContext called to create those child contexts. I'll have to make my primary context static so that my views can get access to the parent injector since I don't instantiate those views or add them to the display list, they will already be onstage when their context is created---does this mean I'll need to force mediator mapping? how?

    I tried to create the child context in initializationComplete event handler of my views but I get an error thrown: "Child context Context-1-cc must not have a parent Injector" here's what I tried similar to your example,
    var c:Context = new Context(); c.injector.parent = MyConfig.context.injector; c.install( MVCSBundle ) .configure(MyConfig) .configure(new ContextView(this));

    Modularity extension, as cool as it is, I don't need but perhaps this thread will help others.

    To satisfy injection point resolution in my views I had the following but this doesn't get automatic mediator mapping
    MyConfig.context.injector.injectInto( this );

  12. Support Staff 12 Posted by Ondina D.F. on 22 Jan, 2014 11:39 AM

    Ondina D.F.'s Avatar

    var c:Context = new Context(); c.injector.parent = MyConfig.context.injector;
    c.install( MVCSBundle )
    .configure(MyConfig) .configure(new ContextView(this));

    MyConfig is probably the config class used by that context. So, if you set c.injector.parent to be MyConfig.context.injector; , you actually set it to the current injector. That's why you get the error.

    In my example I have a parent context (a view created with new SomeModule) and 2 sub-contexts (views added to the main stage). I'm passing the parent's injector on to the sub-contexts, and it works just fine.

    You said that your module is not added to the stage. In this case you have to manually initialize your context: context.initialize();

    I thought your module didn't have a parent context. But if it had a parent, then the error you're getting might be caused by that. So, your settings are different from mine, and I don't have a clue what's going on there without seeing some code.

    I don't instantiate those views or add them to the display list, they will already be onstage when their context is created

    I'm lost. I really don't understand your use case. Are your views added to the stage or not?;) I've made an effort to work with the info you gave me, but there are too many missing pieces...The views should create their own context when they are added to the stage (if they are added to the stage!)...or, as I said, in that method called by the host app.

    You said:

    My views don't directly communicate with each other, but they do share the same services/models to fetch and pull data. If more than one view are in memory they will all be notified when new data arrives.

    For that to happen, either your models and views must reside inside the same context, or if you have several contexts, you need a parent context in order for the sub-contexts to inherit the mappings from the parent, so they can share a model, or to be able to communicate with each other in a way or another.
    You said you didn't need the modularity extension. How are you intending to share your models between different views?

    If your views, with their own context, are added to the stage of the host app or created somehow, and there is no context for the host app, I don't see how you can solve your problem with robotlegs. Maybe you are using interfaces for modular communication or you're accessing the modules through the parent application, but that's not the robotlegs' way. It sounds like a hybrid of robotlegs' MVCS and some other patterns?

    does this mean I'll need to force mediator mapping? how?

    That depends on how your views are created, added or not added to a stage.

    If you map your views with the mediator map, then you can decide when to mediate/unmediate them by using
    mediatorMap.mediate(view);//as an object
    mediatorMap.unmediate(view);

    If a view is not added to the stage you can create a mediator for it in the afterInitializing method of your context, but I think that's somehow odd:

    context.injector.map(SomeView).asSingleton();
    mediatorCreator = new MediatorCreator(SomeMediator);
    mediatorCreator.process(this, SomeView, context.injector);

    So, if I'm not totally misunderstanding your scenario, you create a context from inside set contextPath, when the host app does var someModule:SomeModule = new SomeModule ();
    You create a mediator for SomeModule , and you communicate with other views via interfaces..

    If, on the other hand, SomeModule gets added to the stage, you can create a context and a mediator for the contextView (SomeModule ) as usual, and you, again, communicate with other modules via interfaces or however else.

    If you had a context for the host app (a shell), you could easily create sub-contexts that were able to communicate with the shell and with each other. But, that seems to be an expensive way, since you don't know how many display objects will be watched by robotlegs' ViewManager and StageCrawler.

    Is it really impossible for you to add your own display object to the host app, that could be used as a parent contextView for your other views? Is that host app that obscure? :)

    Perhaps it's just me not seeing a clean solution to your problem and others will have a better suggestion for you. Sorry for not being able to help you!

  13. 13 Posted by Daniel on 24 Jan, 2014 12:39 AM

    Daniel's Avatar

    Oh dear---I'm afraid I've managed to completely confuse you. I sincerely appreciate the time and attention you have given this! Let me take some time to make my situation clear, the progress I've achieved, and the junctions that remain.

    I'm developing a Flex application that is deployed as a module loaded into a host application also developed in Flex. Several points regarding this host application are,
    * I have no access to the source code or developers * it is a container for many other Flex modules that I have no control over (someone else might use RobotLegs!) * it supplies an ad hoc dependency injection framework heavily reliant upon custom metadata tags that are obscure, error prone, and poorly documented * In some situations, I'm required to use the host application's ad hoc dependency injection framework to couple 'alien mediators' with my views (alien in that they are not RobotLegs' mediators though they implement a similar pattern) * my module is not added to the display list, rather I list my view classes in an xml file which the host application can inspect and will then proceed to manage when and where my view classes are instantiated and added to the display list * allows users to bookmark and persist their state and location so I have no control over which view of my module will land on the display list or where * when my module is instantiated I receive a callback from the host application

    So that's a pretty complete picture of the constraints I'm developing within. Now to integrate RobotLegs there are a few problems I've run into
    * I don't have a 'main' view to initialize and configure my context * I want Robot Legs to satisfy injection points in my 'alien mediators' * I have a handful of services and models that all of my views rely and reflect upon

    Various progress/experiments so far,
    * my context is a public static variable instantiated and configured by my module when the host application calls an initialization callback I proffer * manually satisfy DI points in my 'alien view mediators' when they are instantiated by getting a hold of the injector via the static context and calling injector.injectInto( this ); * dispatch events/commands in my 'alien mediators' * create a new context for each 'alien mediator' using its view component to initialize the ContextView and adding this context as a child of the static context. this allows subsequent view components to be mediated with genuine RL mediators (some of that is what this thread has been about) * have my 'alien view mediators' extend RobotLegs Mediator class or implement IMediator, manually add them to the MediatorMap since the view and mediator are instantiated for me outside of my module (not trivial because of access to mediatormap dictionary and scope issues)

    After these experiments, I don't see the value of trying to fit these 'alien mediators' into Robot Legs' mediator shoes,
    * create my static context when my module is initialized * manually injectinto these 'alien mediators' so they get access to the central event bus for listening/dispatching events and model/service singletons * create new context in my 'alien mediators' with ContextView set to their view component and added as a child to the static context (which sets the parent injector)

    (whew) Do you see any pitfalls with this approach?

  14. Support Staff 14 Posted by Ondina D.F. on 24 Jan, 2014 12:34 PM

    Ondina D.F.'s Avatar

    Hehe, OK, let's try it again, step by step.

    First, let's clarify the nature of your views.

    my module is not added to the display list, rather I list my view classes in an xml file which the host application can inspect and will then proceed to manage when and where my view classes are instantiated and added to the display list

    What confuses me is that you're talking about modules and views, as if modules were Flex Modules (as the code you posted somewhere in the beginning of our discussion) and views were regular display objects, like Group, Panel, etc.

    You say that your modules are not added to the stage, but then you mention view classes that are added to the stage. So, the host app loads an XML file with the urls of your components. Are they Flex Modules or not?

    Of course, an application can load a Flex Module and not display it. But, what is the host app displaying then? The "thing" that is displayed, must be added to the stage and thus must be able to react to the added to stage and creation complete events.

    so I have no control over which view of my module will land on the display list or where * when my module is instantiated I receive a callback from the host application

    What I'm getting from that is that the host app is loading an "initial" (Flex?) Module that is not displayed, but it provides the host app with the list of view classes to be displayed at some point in time.
    But that seems to be a wrong assumption, because you said you didn't have a "main" view ( or module?)

    So, the host app is getting the XML list somehow, the XML list contains the urls of various Flex Modules, and the host app is loading a Flex Module from that list? A Flex Module that is not added to the display list, but contains various display objects that can be added to the stage, right? Each loaded Flex Module knows when it is loaded through the callback. But, how does the host app know which display objects from the loaded Module to display? Another XML list?

    See, I'm just going round in circles. I feel really bad for not getting what seems to be so obvious from where you stand.

    I'm insisting on that aspect of loading/displaying your Views/Modules, because of that mention of yours:

    • I have a handful of services and models that all of my views rely and reflect upon

    Are those views inside one loaded Flex Module, meaning each Module has its pair of Models/Services, or do you want to share the Models/Services between all your Modules?

    I also insisted on the added to stage part, because you could have robotlegs Mediators created for those components, instead of those 'aliens' ;)
    But, if what you've tried so far satisfies your needs, go for it.
    I don't know how your alien mediators will behave and how much control do you have over them, when the view is removed from stage. Will they keep a reference to the view and all the things you inject into them? If so, you could run into garbage collection issues. You might want to profile your application with that in mind.

  15. 15 Posted by daniel on 24 Jan, 2014 07:33 PM

    daniel's Avatar

    What confuses me is that you're talking about modules and views, as if modules were Flex Modules (as the code you posted somewhere in the beginning of our discussion) and views were regular display objects, like Group, Panel, etc.

    Yes Flex Modules. I have one Flex module. Inside this module there are a bunch of views (that inherit from DisplayObjectContainer). They are unrelated and the host app adds these to various places for me. Think of Eclipse, as an analogy. If I develop an extension, I might include a welcome tab with some images, and tabs in the preferences window with a bunch of comboboxs/checkboxs, and some panels that show up in the properties window, and then some button that opens a window with a bunch of graphs.

    What I'm getting from that is that the host app is loading an "initial" (Flex?) Module that is not displayed, but it provides the host app with the list of view classes to be displayed at some point in time.

    Yes!

    But that seems to be a wrong assumption, because you said you didn't have a "main" view ( or module?)

    No! not wrong and yes there is no main view, just a collection of MXML views collected into a single Flex Module assembled by the host together in various ways by user driven actions. The host app instantiates the MXML views and adds the in various places of the display list.

    Are those views inside one loaded Flex Module, meaning each Module has its pair of Models/Services, or do you want to share the Models/Services between all your Modules?

    Yes! My Flex Module has some models, and some services. And to illustrate, my MXML views will use these to display a datagrid of properties, send the results of a form off, query the status of some hardware for visual rendering, fetch data that shows up in graphs, and make some drop down list commands available. All of these, that I use are owned by me.

    The host app uses these 'aliens' and they work, in fact I need them sometimes because they have callbacks from the host, like global refresh for instance.

    PS:

    I feel really bad for not getting what seems to be so obvious from where you stand.

    Its not obvious. Thank you thank you thank you for your help and your support.

  16. Support Staff 16 Posted by Ondina D.F. on 25 Jan, 2014 01:26 PM

    Ondina D.F.'s Avatar

    You're welcome, Daniel!

    Now I get it. Actually, I got it almost right the first time, but then I got confused in the course of our discussion.

    I forgot to answer your question from one of your posts:

    To satisfy injection point resolution in my views I had the following but this doesn't get automatic mediator mapping MyConfig.context.injector.injectInto( this );

    If you need to inject properties/classes/objects into your Views, you can use the viewProcessorMap.
    https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...

    If you don't know how to use it, we could discuss your concrete use case, or you could search the forum for discussions on "viewProcessorMap": http://knowledge.robotlegs.org/search?category_id=&amp;q=viewproces...

    The host app uses these 'aliens' and they work, in fact I need them sometimes because they have callbacks from the host, like global refresh for instance.

    Are they green or blue aliens? Just kidding.
    Are you able to create an alien mediator for the Flex Module or just for the added to stage components? I'm asking because if you had an alien mediator for the Flex Module, the alien mediators of the added to stage views could communicate with the "main" alien mediator, in their alien way, letting it know which child context to add to the parent context, in order to avoid references to the parent context inside your various views / subcontexts.
    But, as I said, if you're satisfied with the results of your experiments, go for the approach that feels right for you.

    Are there any more questions you wanted to ask, or can we consider this discussion as resolved for now, and close it? Of course, if the alien invasion becomes unbearable, you can re-open this discussion or create a new one ;)

    Cheers,
    Ondina

  17. Ondina D.F. closed this discussion on 03 Feb, 2014 02:05 PM.

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

Keyboard shortcuts

Generic

? 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