Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.28 KB

mediator_pattern.rst

File metadata and controls

42 lines (27 loc) · 1.28 KB

Mediator pattern

Pattern definition

image

The mediator pattern defines an object that encapsulates how different objects interacts.

This ensures a low coupling between objects because none of them need to have a direct dependency on each other.

Participants in the pattern

Mediator
Is an intermediary that controls the communication between Colleagues.
Colleagues
Represents an object or a component in an application. Each Colleague communicates only with the Mediator.

Mediate implementation of the pattern

image

Participants in mediate implementation

Client
Is an application component or object that needs to communicate with other part of the application. The client sends a message to the Mediator.

Note

In the Mediator pattern the Client is a Colleague.

Concrete Message Handler
Represents an object or a component in an application that receives a concrete message from the Mediator and processes it.

Note

In the Mediator pattern the Concrete Message Handler is a Colleague.