When people talk about event-driven architectures, they often refer to one of the following patterns:
- Event notification
- Event-carried state transfer
- Event sourcing
- CQRS
At times, more than one of these are used together within the same system, depending on what the business requirements are. Let's review each of these patterns in order to identify the scenarios in which they can be used.
The event notification pattern works by emitting events to subscribers once a command is executed. This can be compared to the observer pattern in which you observe a subject that has a list of many listeners or subscribers that are automatically notified when the state of the observed object changes.
This behavior is widely used by event bus libraries that allow publish-subscribe communication among the components that are part of an application. The most common use cases for these libraries are targeted towards the UI, but they are also applicable to...