The following lists the benefits of using the Mediator pattern:
- Decouples colleagues
Simplifies object protocols
- Centralizes Control
- The individual components become simpler and easier to deal with, because they no longer need to directly pass messages to each other
- Components are more generic, because they no longer need to contain logic to deal with their communication with other components.
You should use the Mediator pattern when:
- A set of objects communicate in well-defined but complex ways.
- You want to customize a behavior that's distributed between several objects without using subclasses.