How does the Facade pattern differ from Mediator?

Answer

Both Facade and Mediator hide complexity behind a simpler interface, but their roles differ. A Facade provides a simplified one-way interface to a complex subsystem — the subsystem classes are unaware of the facade's existence, and the facade does not coordinate between subsystem classes; it simply delegates. A Mediator actively coordinates two-way communication between multiple colleague objects — all colleagues know the mediator and send messages through it. The facade is a traffic simplifier for client code; the mediator is a traffic controller that orchestrates peer-to-peer communication. In a chat app, a facade wraps the complex networking layer; a mediator manages the communication between users.