The intermediary mode of IOS design mode

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.