Mediator


Usage
  • Defines simplified communication between classes
  • Define an object that encapsulates how a set of objects interact
  • Promote loose coupling by keeping objects from referring to each other explicitly
  • Vary their interaction independently
Diagram
Mediator
Participants
Mediator
  • Defines an interface for communicating with Colleague objects
ConcreteMediator
  • Implements cooperative behavior by coordinating Colleague objects
  • Knows and maintains its colleagues
Colleague classes
  • Each Colleague class knows its Mediator object
  • Each colleague communicates with its mediator whenever it would have otherwise communicated with another colleague