JAVA7 Large Design Principles

Source: Internet
Author: User

1. Single duty principle (SRP)

Each object or class has only one responsibility. High cohesion, bottom coupling.

2. Opening and closing principle (OCP)

Open for extensions, close for modifications. Usability, flexibility, extensibility, stability continuity, repetition, maintenance.

3. The Richter Replacement principle (LSP)

In the inheritance system, the use of abstract and polymorphic static change to dynamic, that is, any parent class can be replaced with his child class, without affecting the function.

4. Interface isolation principle (DIP)

Split functions to achieve different functions.

5. Dimitri Principle (ISP)

An object is as close to other objects as possible. Is that each class tries to avoid direct communication and reduces coupling.

6. Dependency inversion principle (LOP)

High-level modules rely on the underlying module, (the high-level modules, the underlying modules are set to a dependency interface) to improve the stability of the program, maintainability, scalability.

7. Combination/Aggregation principle (CARP)

Is that the system has better flexibility, first using the combination, and then using inheritance.

JAVA7 Large Design Principles

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.