Namespace: adways.event
Contains base definitions for event handling.
listener
A listener is a function:
dispatcher
A dispatcher is an object on which one listeners can be added. It is responsible of maintaining the map that make the listeners corresponding to a particular "kind" of information. It is also responsible of calling those listeners when it dispatches an event of the corresponding kind.
see {@link adways.event.IEventDispatcherR}
event
An event is an object "thrown/fired/dispatched" by another one to "broadcastly" inform for something. As an exemple, when the value of a number changes, the number may dispatch a "VALUE_CHANGED" event, so that all the objects interested in this number's value can react according to the new value (note: here, "VALUE_CHANGED" is the event's kind).
see {@link adways.event.IEventR}
kind
The kind is a constant that conceptually identifies the information carried up by the event. It allows the association "event <-> listeners" done by the dispatcher.
principes
- Some "listener" functions are attached to a "dispatcher" for a particular "event".
- Something happens to the dispatcher that should be notified to other objects.
- So the dispatcher dispatches an event.
- All the listeners attached to the dispatcher for this event are called during the dispatching operation.
- These listeners should execute the right operations so that the objects they belong to react correctly.
listener
A listener is a function:
function myListener (e:adways.event.IEventR) { ... }
dispatcher
A dispatcher is an object on which one listeners can be added. It is responsible of maintaining the map that make the listeners corresponding to a particular "kind" of information. It is also responsible of calling those listeners when it dispatches an event of the corresponding kind.
see {@link adways.event.IEventDispatcherR}
event
An event is an object "thrown/fired/dispatched" by another one to "broadcastly" inform for something. As an exemple, when the value of a number changes, the number may dispatch a "VALUE_CHANGED" event, so that all the objects interested in this number's value can react according to the new value (note: here, "VALUE_CHANGED" is the event's kind).
see {@link adways.event.IEventR}
kind
The kind is a constant that conceptually identifies the information carried up by the event. It allows the association "event <-> listeners" done by the dispatcher.