Encyclopedia > Event-driven programming

  Article Content

Event-driven programming

Event-driven programming is a computer programming paradigm. 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. Graphical user interface programs are typically programmed in an event-driven style.

Computer operating systems are another classic example of event-driven programs at at least two levels. At the lowest level, interrupt handlers[?] act as direct event handlers for hardware events, with the CPU hardware performing the role of the dispatcher. Operating systems also typically act as dispatchers for software processes, passing data and software interrupts[?] to user processes[?] that in many cases are programmed as event handlers themselves.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Christiania

... can refer to: Christiania - the name of Oslo, from 1624 to 1925. The Free State of Christiania - a partially self-governing neighborhood in the ...

 
 
 
This page was created in 24.5 ms