Event-driven programming

In computer programming, event-driven programming is a programming paradigm in which the flow of the program is determined by external events. Typical event can be UI events from mice, keyboards, touchpads and touchscreens, or external sensor inputs, or be programmatically generated (message passing) from other programs or threads, or network events.

Event-driven programming is the dominant paradigm used in graphical user interfaces applications and network servers.

In an event-driven application, there is generally an event loop that listens for events and then triggers a callback function when one of those events is detected.

Event-driven programs can be written in any programming language, although the task is easier in languages that provide high-level abstractions.

Although they do not exactly fit the event-driven model, interrupt handling and exception handling have many similarities.

It's important to differentiate between event-driven and message-driven (aka queue driven) paradigms: Event-driven services (e.g. AWS SNS) are decoupled from their consumers. Whereas queue / message driven services (e.g. AWS SQS) are coupled with their consumers. [1]

  1. ^ Chandrasekaran, Premanand; Krishnan, Karthik; Ford, Neal; Byars, Brandon; Buijze, Allard (2022). Domain-Driven Design with Java - A Practitioner's Guide. Packt Publishing. ISBN 9781800564763.

© MMXXIII Rich X Search. We shall prevail. All rights reserved. Rich X Search