Broker Mode :
Using an object to encapsulate the interaction of a series of objects, the mediator makes the objects not need to be referenced to each other, so that they are loosely coupled and can change their interactions independently.
When to use the Mediator mode:
(1): The interaction between objects is clearly defined and complex, resulting in a set of objects that are interdependent and difficult to understand.
(2): objects are difficult to reuse because they reference many other objects and communicate with them
(3): You want to customize a logic or behavior that is distributed across multiple classes, and you don't want to generate too many subclasses.
Disadvantages:
Although the broker pattern is useful in situations where the behavior of the processing application is scattered and interdependent, it should be avoided to make the mediator class too large and difficult to maintain, and if the mediator class is too large, consider other patterns to decompose it.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The intermediary mode of IOS design mode