Image example:
It's hard to figure out who should pay for each other when I play mahjong with four mm. Fortunately, I was there, counting the money based on my chips and getting the money from me, if I lose the money, I will pay it to me. Everything will be OK, And I will receive four mm calls.
Mediator mode:
The mediator mode encapsulates a series of object interaction methods, so that these objects do not have to interact explicitly. So that they can be loosely coupled. When the roles of some objects change, the roles of other objects are not immediately affected. Ensure that these functions can be changed independently of each other. The mediator mode converts the multi-to-many interaction into one-to-many interaction. The mediation mode abstracts the behavior and collaboration of objects, and processes the interaction between objects and other objects on a small scale.
Design Pattern _ mediator _ Mediator Pattern