GoF Statement of Intent:![]() |
Define an object that encapsulates how a set of objects interact.
Mediator promotes loose coupling by keeping objects from referring to
each other explicitly, and lets you vary their interaction independently. |
Brief Overview:![]() |
Provides a unified interface to a set of interfaces in a subsystem. So it is
similar to the façade. This is a behavioral pattern due to the way it can alter
the program's running behavior. Usually a program is made up of a large number
of classes which handle different logic and computational tasks. As more classes
are added during maintenance and/or refactoring the problem of communication between
these classes becomes more complex and difficult to change.
The mediator encapsulates communication between objects so that objects no longer
communicate directly with one another but via the mediator. This reduces dependencies
between objects and improves decoupling. |
UML Diagram: |
![]() |