Event model
From Wikipedia, the free encyclopedia
It has been suggested that this article or section be merged with Event (computing). (Discuss) |
The event model is a programming paradigm commonly used in building graphical user interfaces. A very common and very programmer-friendly variant is the delegate event model, which is provided by the most popular graphic frameworks.
[edit] Delegate event model
This model is based on three entities:
- a control, which is the event source
- consumers, also called listeners, that receive the events from the source
- interfaces (in the broader meaning of the term) that describe the protocol by which every event is to be communicated
Furthermore the model requires that:
- every listener must implement the interface for the event it wants to listen to
- every listener must register with the source, to declare its desire to listen to some particular event
- every time the source generates an event, it communicates it to the registered listeners, following the protocol of the interface