Event-Driven Programming Pattern
Jump to navigation
Jump to search
An Event-Driven Programming Pattern is a programming pattern that implements the observer pattern to structure program flow around detecting and responding to computing events.
- Context:
- It can (typically) structure program flow through:
- It can (typically) handle event types such as:
- It can (often) implement event mechanisms using:
- ...
- Examples:
- GUI Programming, such as:
- System Programming, such as:
- ...
- See: Closure (Computer Science), Event-Driven Architecture, Event (Computing), Message Passing, Thread (Computer Science), Graphical User Interfaces, Web Applications, User Input.
References
2017
- (Wikipedia, 2017) ⇒ https://en.wikipedia.org/wiki/event-driven_programming Retrieved:2017-3-31.
- In computer programming, event-driven programming is a programming paradigm in which the flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs/threads. Event-driven programming is the dominant paradigm used in graphical user interfaces and other applications (e.g. JavaScript web applications) that are centered on performing certain actions in response to user input. This is also true of programming for device drivers (e.g. P in USB device driver stacks )
In an event-driven application, there is generally a main loop that listens for events, and then triggers a callback function when one of those events is detected. In embedded systems the same may be achieved using hardware interrupts instead of a constantly running main loop. Event-driven programs can be written in any programming language, although the task is easier in languages that provide high-level abstractions, such as closures.
- In computer programming, event-driven programming is a programming paradigm in which the flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs/threads. Event-driven programming is the dominant paradigm used in graphical user interfaces and other applications (e.g. JavaScript web applications) that are centered on performing certain actions in response to user input. This is also true of programming for device drivers (e.g. P in USB device driver stacks )