Revision Notes/Design Patterns

Field Entry  -  Design Patterns

 Coreintermediate

Mediator Pattern

Reduces chaotic dependencies between many objects by routing all communication through a central mediator object — objects talk to the mediator, not to each other.

#behavioral#mediator#coordination#decoupling#gof

Field Note - Real-world Analogy

Think of it like this

Like air traffic control (ATC). Planes (components) don't talk to each other directly about landing order, runway availability, and timing — that would be chaos. Instead, every plane talks only to ATC (the mediator), and ATC coordinates everything. The planes are decoupled from each other; only ATC knows the big picture.

Field Observations - Key Topics Covered

01

The problem Mediator solves: in a complex UI form with 10 fields, when you check a checkbox, it might disable 3 fields, change the options in a dropdown, and show a hidden section. Without Mediator, each component holds references to all the others it needs to update — the components become tightly coupled in a web of dependencies that's very hard to change.

4 more observations inside

Sign in to read every key point in full

Unlock Full Note

Ready to go deeper?

Open the complete revision note.

Sign in to read every field observation in full, including a runnable code example and side-by-side comparisons with related patterns.

Read Full Notes