Event model

del.icio.us del.icio.us
Digg Digg
Furl Furl
Reddit Reddit
Rojo Rojo
Add to OnlyWire

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.

Delegate event model

Delegate event model. Click me is the event source (a button in this example), and it contains a list of listeners.
Delegate event model. Click me is the event source (a button in this example), and it contains a list of listeners.

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

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.


Giant Panda

Mercedes Car
James Bond Guide
This site monitored by SitePinger.net