The differences between observer, pubsub, and mediator pattern
Understanding the basic differences between the 3 patterns.
Observer: the publisher must know and manage observers, observers will be attached to the specific publisher:
Pubsub: the publisher can publish an event without knowing who are the listeners, publisher and listeners communicate through the event channel:
Mediator: groups logic of domain that has indirect relationship between modules. We can use Pubsub
(not required, can use other patterns) to manage the workflow :