Discussion and relationships involved in Events
CategoryEvents
- An event can result in the notification (message) that an action has occurred
- a change in state
- a result of the user clicking the mouse
- pressing a key
- An event can be recognized by testing or analysis of a context for the evidence of a change
- An EventHandler is code
- typically a function or routine written to receive control when an event occurs
Notification Action / Reaction
The notification and the action are both signals. You discuss an 'observed' change in state, a 'recognized' click of the mouse or press of the button. And an event handler provides a simplistic form of reflexive behavior -- a triggered response, a reaction. The proper abstraction is a pairing: an observable 'trigger' (possibly abstracted over a context, allowing some variation on the observation) is paired with an executable 'action' (which may be adjusted by context) to form this 'reaction'. I'm studying this sort of material actively if you're interested in discussing it.
ActionEvent messages are meant to be received by Registered ActionListeners?
- Summarization -- An event is a state change that matters to someone. -- MichaelFeathers
- The method used to keep track of who it is that is concerned is via Registration as ActionListeners?
- ...
Messages may be acted upon immediately or may be inserted in an EventQueue
- Messages from ActionEvents may not require immediate action, or may be acted upon in conjuction with other related event. Thus an EventQueue allows a method of synchronizing the reactions required based upon the combination of events and states.
- ...
ObservationOfEvents vs InitiationOfEvents
- Events can be recognized by an uninvolved observer, or can be messaged to listeners by the initiator
- the first is is such that recognition may not be assured, the second is structurally provided and its surety depends upon the listener being connected.
Related: ActionEvents AccessorEvents EventQueue SynchronizeOnEvents MessagingPatterns EventDrivenProgramming
CategoryEvents