nyklogistics
16 Oct 2008, 7:45 PM
What is the different of Dispatcher.get().dispatch() & Dispatcher.forwardEvent()?
Thanks
eugenparaschiv
16 Oct 2008, 11:12 PM
No difference I can think of.
cravemusic
20 Oct 2008, 2:13 PM
I've been drawing a line between the two based on if the event was just given memory, or if it already exists in memory.
An event can only originate in one place, so when a method is creating an event (by calling new to allocate memory for it), use dispatch() to inform the rest of the app about the event. If an event has already been created, occupies memory, and needs to be sent to another object, then it's appropriate to use forwardEvent().
However, the above is really just how I organize things in my head -- seeing which way I move events around tells me if the event was created in the vicinity, or it was created at some other unknown source. If you look at the source for Dispatcher, you'll see that forwardEvent() is just a wrapper around the dispatch() instance.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.