Java Design Patterns (1) Seven Principles of--java design pattern

Source: Internet
Author: User

Seven major design principles:

1. Single Duty principle: one class is responsible for a duty.
2, the Richter replacement principle: Subclasses can extend the function of the parent class, but cannot change the original function of the parent class.
3, dependency inversion principle: The high-level module should not rely on the lower layer module, both should rely on its abstraction; abstraction should not depend on detail; detail should depend on abstraction. That is, for interface programming, do not program for implementation.
4, interface Isolation principle: the establishment of a single interface, do not set up a huge bloated interface, as far as possible to refine the interface, the interface of the method as little as possible.
5, Dimitri Law: low coupling, cohesion poly.
6, open and close principle: a software entity such as classes, modules and functions should be opened to the extension, the modification is closed.
7. Combination/Aggregation multiplexing principle: Use combination and aggregation sparingly and use inherited relationships to achieve the principle of reuse.

Java Design Patterns (1) Seven Principles of--java design pattern

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.