From WikiChip
Difference between revisions of "Event-driven programming"

m (David moved page Event-driven to Event-driven programming: better title)
(expanded upon)
 
Line 1: Line 1:
Event-driven programming languages are styles where each program acts and reacts based on certain events, such as messages, user-actions (mouse clicks) and so forth.
+
'''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.

Latest revision as of 05:22, 4 December 2013

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.