What are Mediator's downsides?
The Mediator pattern solves the problem of excessive links between objects, but it can itself create new complications when overused.
1. The Mediator Can Become a "God Object"
The main risk is the gradual growth of the mediator. When all interaction is concentrated in one class, it starts managing too many processes, from UI logic to business rules.
Eventually Mediator turns into a "monolithic controller" where changes in one part affect everything else.
2. Difficulty Understanding and Maintaining the Logic
The system's behavior becomes less transparent, components no longer interact directly, and understanding who calls what requires studying the mediator's code.
This reduces readability, especially with many events and states.
3. Scalability Problems
As the number of participants grows, the Mediator has to account for more combinations of interactions. This complicates the structure, and any new logic requires changing the mediator, which partially violates the open/closed principle (OCP).
4. Risk of Excessive Centralization
Instead of many dependencies between objects, you get one giant dependency on the mediator. All components become loosely coupled to each other, but tightly coupled to the Mediator.
5. Reduced Performance (in Some Scenarios)
If the mediator handles a large number of events or notifications, an extra layer of calls and temporary overhead can appear.
Conclusion
| Disadvantage | Essence |
|---|---|
| "God object" | The mediator becomes overloaded with logic |
| Loss of transparency | Hard to understand who calls whom |
| Violation of OCP | Any new interaction requires changing Mediator |
| Excessive centralization | Everyone depends on a single mediator |
| Possible overhead | Extra steps when passing messages |
Summary: The Mediator pattern reduces coupling, but when misapplied it creates a new point of fragility, an overloaded coordinator that concentrates too much logic and too many dependencies.
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.