tag:robotlegs.tenderapp.com,2009-10-18:/discussions/suggestions/64-dispatchevent-in-contextRobotlegs: Discussion 2018-10-18T16:35:30Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/89402372011-07-28T20:50:18Z2011-07-28T20:50:18ZdispatchEvent in Context<div><p>Hi ! I think that you need to add a method "dispatch" in Context
(or ContextBase) class.</p>
<p>At least for me is a bit confusing to have a dispatchEvent that
dispatch a framework event.<br>
When I write "dispatch" I know that I'm using the framework event
bus, when I use dispatchEvent I know that I'm using a custom
dispatcher (probably a view).</p>
<p>But In Context we use dispatchEvent instead of dispatch :(</p>
<p>Regards !</p></div>Enriquetag:robotlegs.tenderapp.com,2009-10-18:Comment/89402372011-07-29T09:50:09Z2011-07-29T09:51:01ZdispatchEvent in Context<div><p>Hi Enrique,</p>
<p>Believe it or not, but it still happens to me too, from time to
time:</p>
<p>I type dispatch instead of dispatchEvent in the Context’s
implementation</p>
<p>, and I’m not new to rl.</p>
<p>I don’t know the exact reason for not having this</p>
<pre>
<code>
protected function dispatch(event:Event):Boolean
{
if(eventDispatcher.hasEventListener(event.type))
return eventDispatcher.dispatchEvent(event);
return false;
}
</code>
</pre>
<p>in the org.robotlegs.mvcs.Context.as.<br>
Probably because the Context is considered to be just a
“container” for the rl actors, and its roles should be
limited to: “provide initialization, provide
de-initialization, and provide the central event bus for
communication” and not more?<br>
So except for ContextEvent.STARTUP, ContextEvent.STARTUP_COMPLETE,
ContextEvent.SHUTDOWN_COMPLETE, which are provided as a hook, to
facilitate the startup process, the Context shouldn’t
dispatch any other framework events, I guess.</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/89402372011-07-29T12:40:32Z2011-07-29T12:40:33ZdispatchEvent in Context<div><p>mmm... I think that the real reason for having dispatchEvent
instead of dispatch is that ContextBase implements
IEventDispatcher, so we need a dispatchEvent.<br>
But we can add a dispatch method too.</p></div>Enrique