Mediator
Reduce coupling between communicating objects
Overview
Mediator reduces chaotic dependencies between objects. The pattern restricts direct communications between the objects and forces them to collaborate only via a mediator object.
Code Example
java
1public interface ChatMediator { void sendMessage(String msg, User user); void addUser(User user); }
2// User objects talk to ChatMediator instead of directly to each other