Java design Pattern (general)

Source: Internet
Author: User

1. Object-Oriented design principles
    • Single Duty principle: one class is responsible for the corresponding responsibilities in one functional area
    • Open and Close principle: Software entities should be opened for expansion and closed for modification;
    • The Richter substitution principle: All references to base class objects can transparently use objects of their subclasses;
    • Dependency reversal principle: abstraction should not depend on detail, detail should depend on abstraction;
    • Interface Isolation principle: use multiple specialized interfaces without using a single total interface;
    • The principle of synthetic reuse: Try to use object combination rather than inheritance to achieve the purpose of reuse;
    • Dimitri Law: A software entity should interact with other entities as little as possible;
2. The software model's infrastructure consists of four parts:
    • Description of the problem (what is the problem to be solved)
    • Prerequisites (used under what conditions or constraints)
    • Solution (how to solve)
    • Effect (what are the pros and cons)
3. According to the use, the design pattern is divided into:
    • 5 Types of Creation (describes how to create objects)
    • Structural type (describes how to implement a class or object combination) 7 kinds
    • Behavioral type (describe how classes or objects interact and assign responsibilities) 11
3.1 Create-mode:
    • Simple Factory mode
    • Factory method Mode
    • Abstract Factory mode
    • Single-Case mode
    • Prototype mode
    • Builder mode
3.2 Structural mode:
    • Adapter mode
    • Bridging mode
    • Combination mode
    • Decoration mode
    • Appearance mode
    • Enjoy meta mode
    • Proxy mode
3.3 Behavioral Mode:
    • Responsibility chain Model
    • Command mode
    • Interpreter mode
    • Iterator mode
    • Broker mode
    • Memo Mode
    • Observer pattern
    • State mode
    • Policy mode
    • Template method Mode
    • Visitor mode


Resources:

    • Design mode (Java edition)

Java design Pattern (general)

Related Article

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.