Event-driven architecture
Event-driven architecture (EDA) is a software architecture pattern promoting the production, detection, consumption of, and reaction to events.
Contents
Description
An event can be defined as "a significant change in state".
For example, when a consumer purchases a car, the car's state changes from "for sale" to "sold". A car dealer's system architecture may treat this state change as an event whose occurrence can be made known to other applications within the architecture.
From a formal perspective, what is produced, published, propagated, detected or consumed is a (typically asynchronous) message called the event notification, and not the event itself, which is the state change that triggered the message emission. Events do not travel, they just occur. However, the term event is often used metonymically to denote the notification message itself, which may lead to some confusion.
Architectural pattern
This architectural pattern may be applied by the design and implementation of applications and systems which transmit events among loosely coupled software components and services.
An event-driven system typically consists of event emitters (or agents), event consumers (or sinks), and event channels.
Emitters
Emitters have the responsibility to detect, gather, and transfer events.
An Event Emitter does not know the consumers of the event, it does not even know if a consumer exists, and in case it exists, it does not know how the event is used or further processed.
Sinks
Sinks have the responsibility of applying a reaction as soon as an event is presented.
The reaction might or might not be completely provided by the sink itself.
For instance, the sink might just have the responsibility to filter, transform and forward the event to another component or it might provide a self-contained reaction to such event.
Event channels
Event channels are conduits in which events are transmitted from event emitters to event consumers.
The knowledge of the correct distribution of events is exclusively present within the event channel. The physical implementation of event channels can be based on traditional components such as message-oriented middleware or point-to-point communication which might require a more appropriate transactional executive framework.
Building applications and systems
Building applications and systems around an event-driven architecture allows these applications and systems to be constructed in a manner that facilitates more responsiveness, because event-driven systems are, by design, more normalized to unpredictable and asynchronous environments.
Service-oriented architecture
Event-driven architecture can complement service-oriented architecture (SOA) because services can be activated by triggers fired on incoming events.
This paradigm is particularly useful whenever the sink does not provide any self-contained executive.
See also
- Computer science
- Computing
- Model-view-controller
- Service-oriented architecture
- Software architecture
- Software engineering
- State (computer science)
External links
- Event-driven architecture @ Wikipedia