---
# System prepended metadata

title: Mediator

---

# Mediator

https://refactoring.guru/design-patterns/mediator

> Mediator is a behavioral design pattern that lets you reduce chaotic dependencies between objects. The pattern restricts direct communications between the objects and forces them to collaborate only via a mediator object.

仲介的意思

 
![](https://i.imgur.com/7Qz5j2Y.png)
![](https://i.imgur.com/4XiH8vc.png)

有點像 jQuery & Vue 的差別

## Structure
![](https://i.imgur.com/GRUqb1R.png)

## Pros and Cons
![](https://i.imgur.com/P7UeK5Y.png)
