Browse Java Design Patterns & Enterprise Application Architecture

Mediator vs. Observer Pattern

Compare Mediator and Observer in Java so centralized coordination and event notification are not treated as the same design move.

On this page

Mediator and Observer both reduce direct coupling, but they do it differently.

Mediator

Mediator says:

  • one explicit coordinator should own the interaction rules
  • participants report to the mediator
  • the mediator decides what happens next

Observer

Observer says:

  • a subject emits changes
  • interested listeners react
  • the subject does not coordinate all downstream behavior directly

Java Shortcut

Ask:

  • “Do I need one place to coordinate many components?” -> Mediator
  • “Do I need many listeners to react to a change?” -> Observer

The difference is central coordination versus distributed reaction.

Revised on Thursday, April 23, 2026