Mediator< Computer Science Design Patterns
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.
Mediator — defines the interface for communication between Colleague objects. ConcreteMediator — 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 — communicates with other Colleagues through its Mediator.
This pattern is not expensive because there is not much constraint on it.
This pattern is easy to create.
This pattern is easy to maintain.
Each object can easily be transformed to another structure using refactoring.
- Put the mediator term in the name of the iterator class to indicate the use of the pattern to the other developers.