Design Patterns (GoF) (50 Qs)•Part 3: Architectural Patterns & Enterprise Systems (25 - 35)
Mediator Pattern: Decoupling communication dependencies into a central hub.
mid Leveldesign-patternsArchitectural Patterns
In Simple Words: When dozens of components communicate directly with each other, they form a chaotic $O(N^2)$ web of tight coupling:
- Mediator Pattern: Components (Colleagues) communicate strictly through a central Mediator object.
- Real-World Example:
- Air Traffic Control tower: Airplanes do not radio each other to coordinate landings; they communicate exclusively through the ATC tower.
- MediatR in .NET / CQRS: Decouples HTTP controllers from domain query/command handlers via in-process mediation.