Design Pattern: Mediator Pattern in Java

Mediator pattern is used to restrict direct interaction between objects. A mediator class works as the middleman/communicator when one object wants to connect/use another object. This article demonstrates Mediator pattern implementations in Java.

Design Pattern: Mediator Pattern

Mediator pattern prevents direct interaction between objects and works as a middleman. As objects can not refer to another object directly in this pattern, that’s why it ensures loose coupling. In Mediator pattern, all communication between objects will be through the Mediator.