Computer Science Design Patterns/Mediator

{{Computer Science Design Patterns/Page This pattern defines an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently. This pattern helps to model a class whose object at run-time is responsible for controlling and coordinating the interactions of a group of other objects.
 * mode={{{mode|reading}}}
 * page={{{page|{{SUBPAGENAME}}}}}
 * stage=25
 * stage date=14 Feb, 2014
 * stage comment=Add more illustrations.
 * previous=Iterator
 * next=Memento
 * content=

Participants
Mediator &mdash; defines the interface for communication between Colleague objects. ConcreteMediator &mdash; implements the Mediator interface and coordinates communication between Colleague objects. It is aware of all the Colleagues and their purpose with regards to inter communication. ConcreteColleague &mdash; communicates with other Colleagues through its Mediator.

Cost
This pattern is not expensive because there is not much constraint on it.

Creation
This pattern is easy to create.

Maintenance
This pattern is easy to maintain.

Removal
Each object can easily be transformed to another structure using refactoring.

Advises

 * Put the mediator term in the name of the iterator class to indicate the use of the pattern to the other developers.

Implementations
}}