From WikiChip
Event-driven programming
Revision as of 04:22, 4 December 2013 by David (talk | contribs) (expanded upon)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Event-driven programming (EDP) is a programming paradigm whereby portions of the program are executed as a result of certain inputs or event - e.g. as reaction to significant signals known as events. The type of events can range greatly from user-driven (e.g. mouse click, mouse move, or a key press), to sensor input, to timers, and to messages passed from other programs or processes. In contrast with traditional programming paradigms where the control flow of the program is determined by the program structure, the control flow of event-driven-based programming is mostly driven by external events.

Event-driven programming typically, but not always, make sure of a main event loop that continuously waits for events to happen. Upon receiving an event that has semantic significance to the program, the event is passed to an appropriate section of the program, such as using an event handler, to be handled.