Child Context and Installed Bundles

jj's Avatar


24 Jan, 2014 07:41 PM

How are bundles related to child contexts? Are the bundles of a parent installed and available for the children or just the injector is shared?

` var c1:Context = new Context()
.install( MVCSBundle ) .configure( MyConfig ) .configure( new ContextView( this ) );

var c2:Context = new Context()
.configure( MyConfig2 ) .configure( new ContextView( that ) );

c.addChild( c2 );

  1. Support Staff 1 Posted by Ondina D.F. on 25 Jan, 2014 12:10 PM

    Ondina D.F.'s Avatar


    Extensions are not inherited by the child context.

    Each new Context does this:
    _extensionInstaller = new ExtensionInstaller(this);

    When you say context.install(MVCSBundle);

    the Context does this:

    public function install(... extensions):IContext
        for each (var extension:Object in extensions)
        return this;


    Each Context can use its own extensions defined in a class that implements IBundle. You can add your own extensions to that bundle, or choose only the extensions provided by the framework that you really need in that Context. Say, you don't need the MediatorMapExtension or the TraceLoggingExtension, you simply don't add them to the bundle.

    Each Context does this:

    private const _injector:IInjector = new RobotlegsInjector();

    When a child context is added:,
    the parent Context does this:

    child.injector.parent = injector;

  2. Ondina D.F. closed this discussion on 03 Feb, 2014 02:07 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