Design principles and 23 design patterns of JAVA6

Source: Internet
Author: User

Java Six Design Patterns

1. Single responsibility Rule (SRP): There is only one reason for the change of class.

2. Dependency inversion rule (DIP):

1, the high-level module should not rely on the underlying module, both with the dependency interface;

2, the interface does not depend on the details;

    3, the detail depends on the interface.

3. Interface isolation rules: dependencies between classes should be based on a minimum number of interfaces.

4, the Richter replacement rule: So the reference base class can be transparent to the use of sub-class objects.

5, Dimitri Law: Also called least know the principle. That is, an object should have a minimal understanding of other objects.

6, opening and closing rules: open to the expansion, the modification is closed.

Design principles and 23 design patterns of JAVA6

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.