About
An event-oriented model is a system that is driven from an event point of view, not from a state point of view. Ie:
- when an event occurs,
- transformation happens to the entities
- that change their states.
It's a publish-subscribe messaging system.
An event is a state change, or an update, like adding a shopping item to a cart on an e-commerce website.
An event-oriented model is also known as an Event-Driven Architecture (EDA).
This type of architecture is commonly used in microservices to communicate between services.
Async Request
This model is based on async requests that communicate or inform that something happened.
Usage Example
Reporting/ analytics
Code Execution
- events in a graphical user interface (GUI) application, such as keyboard actions, mouse actions, and scroll actions
- All code engines that implements an event loop such as Javascript
Model
Instead of focusing on the current state, you focus on the events (changes) that occurred over time.
The event (that starts the flow/chain) must get the system moving by changing its state (ie which event will get the system moving).
In an event-driven architecture:
- the events are facts, not the state.
- Events are the notifications (trigger) for transition.
The events are clustered to create a chain of transformations based on their relationship. They are not grouped based on the state of the entity as in a process oriented model.
The model starts with an event and describes all transformations on the entities. ie the model system's behavior is described in terms of a sequence of transformation (not in a sequence of state).
Activities are not modeled directly as in a life-cycle model. Rather they are implied by scheduling an event for the point in simulation time they will be finished.
How do you visualize an event-driven model?
In the visual process flow, the nodes are the transformation, not the state of the entity as in a state model.
What is the Main Entry ?
The main entry in an event-driven system is called:
- an event loop, for code execution
- or a broker, for reporting/analytics
Steps
Identify the relevant entities
To build an event-based model, we must identify all relevant objects and their properties.
Describe the behavior of the system
- Description of Behavior (Events)
- identify the events that “drive” our model (ie the events that change the state of the system)
- Write down the types of events that occur in the system
- For each event type, specify the transformations and interactions of the relevant entities, e.g. by drawing a UML activity diagram. Example