tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/9381-child-context-and-installed-bundlesRobotlegs: Discussion 2014-02-03T14:07:49Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/312937712014-01-25T12:10:47Z2014-01-25T12:10:47ZChild Context and Installed Bundles<div><p>Hi,</p>
<p>Extensions are not inherited by the child context.</p>
<p>Each new Context does this:<br>
_extensionInstaller = new ExtensionInstaller(this);</p>
<p>When you say context.install(MVCSBundle);</p>
<p>the Context does this:</p>
<pre>
<code>public function install(... extensions):IContext
{
for each (var extension:Object in extensions)
{
_extensionInstaller.install(extension);
}
return this;
}</code>
</pre>
<p>_extensionInstaller.install(extension):<br>
<a href=
"https://github.com/robotlegs/robotlegs-framework/blob/master/src/robotlegs/bender/framework/impl/ExtensionInstaller.as#L57">
https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...</a></p>
<p>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.</p>
<p>Each Context does this:</p>
<p>private const _injector:IInjector = new RobotlegsInjector();</p>
<p><a href=
"https://github.com/robotlegs/robotlegs-framework/blob/master/src/robotlegs/bender/framework/impl/Context.as#L43">
https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...</a></p>
<p>When a child context is added: <a href=
"https://github.com/robotlegs/robotlegs-framework/blob/master/src/robotlegs/bender/framework/impl/Context.as#L43">
https://github.com/robotlegs/robotlegs-framework/blob/master/src/ro...</a>,<br>
the parent Context does this:</p>
<p>child.injector.parent = injector;</p></div>Ondina D.F.