The mediator pattern is based on two abstractions: Mediator and Colleague, as shown in the following class diagram:
The mediator pattern relies on the following classes:
Mediator: This defines how the participants are interacting. The operations declared in this interface or abstract class are specific to each scenario.
ConcreteMediator: This implements the operations declared by the mediator.
Colleague: This is an abstract class or interface that defines how the participants that need mediating should interact.
ConcreteColleague: These are the concrete classes implementing the Colleague interface.