tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/18-how-can-i-get-every-contexts-model-between-contextsRobotlegs: Discussion 2013-04-28T10:30:51Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/6851382009-12-07T15:44:05Z2009-12-07T15:44:05ZHow can I get every context's model between Contexts?<div><p>Robotlegs does not make use of the Facade design pattern. The
Context is just a place to Bootstrap your application. If you want
to share a Model between your application Actors, you would set it
up for injection (in the Context's startup method, or in a
Command):</p>
<p><code>injector.mapSingleton(MyModel);</code></p>
<p>And then depend on it wherever you need it:</p>
<pre>
[Inject]
public var myModel:MyModel;
</pre>
<p>Declaring dependencies is a much better approach than reaching
into a container/registry (the Facade) and grabbing what you
need.</p></div>Shaun Smith