Mediator code examples of PHP design patterns (24)

Time:2020-11-27

objective
This pattern provides an easy way of weak coupling among multiple components. If you have an “intelligence center,” observer mode is also a good choice, similar to a controller (not a controller in the sense of MVC).

In object-oriented programming, it’s a good thing to have a good friend than to have multiple friends. This is an important feature of the pattern.
UML diagram

The official PHP advanced learning exchange community “click” manages and sorts out some materials. Bat and other first-line factories have advanced knowledge systems (related learning materials and written test questions) and are not limited to: distributed architecture, high scalability, high performance, high concurrency, server performance tuning, tp6, laravel, yii2, redis, swote, soft, Kafka, MySQL optimization, shell script, dock Er, micro service, nginx and other knowledge points
code
MediatorInterface.php

database = $database;