Event-driven programming
Appearance
Event-driven programming is a style of computer programming. Unlike traditional programs, which follow their own control flow pattern, only sometimes changing course at branch points, the control flow of event-driven programs is largely driven by external events.
Event-driven programs typically consist of a number of small programs called event handlers, which are to be called in response to external events, and a dispatcher, which calls the event handlers, often using an event queue to hold unprocessed events.
In many cases event handlers can trigger events themselves, possibly leading to an event cascade.
Event-driven programming stresses flexibility and asynchrony as virtues, and tries to be as modeless as possible.