iOS Common design pattern notes

Source: Internet
Author: User

First, the principle

1. Single Duty principle (Responsiblity Principle SRP)

2. Opening and closing principle (Open Closed PRINCIPLE,OCP)

3, the Richter replacement principle (Liskov Substitution PRINCIPLE,LSP)

4. Dependence reversal principle (Dependency inversion Principle,dip)

5. Interface Isolation principle (Interface segregation principle,isp)

6. Synthesis/Aggregation multiplexing principle (composite/aggregate reuse Principle,carp)

7. Minimum knowledge principle (Principle of Least Knowledge,plk, also called Dimitri Law)

Second, the content

1. Object creation Type: Factory method, abstract factory, prototype mode, generator mode, singleton mode.

2, interface adaptation type: Appearance mode, adapter mode, bridge mode.

3, the object decoupling type: The mediator pattern, the Observer pattern.

4. Abstract set Type: Combination mode, iterator mode.

5, Behavior expansion Type: Visitor mode, responsibility chain mode, decoration mode.

6, the algorithm encapsulation type: template mode, command mode, policy mode.

7, performance Optimization and object access type: Enjoy meta-mode, proxy mode.

8. Object state Type: Memo Mode

Third, the role

1. Make code compilation truly engineering

2, realize the reuse of code, make the code easier to be understood by others, to ensure the reliability of the code.

Iv. Matters of note

1, for the interface programming, not for the implementation of programming

2. @protocol and abstract class

3. Object combination and Object inheritance

iOS Common design pattern notes

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.