What is the Mediator design pattern?

Answer

The Mediator pattern reduces chaotic dependencies between objects by forcing them to communicate through a central mediator object instead of directly with each other. This turns a many-to-many web of dependencies into a hub-and-spoke model. An air traffic control tower is the classic analogy: planes don't communicate with each other; they all talk to the tower (mediator). In software, a chat room mediates message passing between users, and a UI dialog can act as a mediator — when a checkbox is clicked, instead of the checkbox knowing about the text field and the button, it notifies the dialog, which decides what to update.