JAVA design patterns-learning Summary (sequence), java Design Patterns

Source: Internet
Author: User

JAVA design patterns-learning Summary (sequence), java Design Patterns

Design ModeDesign pattern is a summary of the code Design experience that has been used repeatedly. The design pattern is used to make code reusable, make it easier for others to understand, and ensure code reliability.

There are 23 common design patterns. There are three categories:
Creation Mode:Factory method mode,Abstract Factory mode,Singleton mode,Builder mode and prototype mode.
There are seven structural modes:Adapter mode, decorator mode, proxy mode,Appearance mode, bridging mode, combination mode, and metadata mode.
11 behavior models:Rule mode, template method mode, observer mode,Iteration submode, responsibility chain mode, command mode, memorandum mode, state mode, visitor mode, intermediary mode, interpreter mode.

Principle of design pattern-Open Close Principle (Open Close Principle)
The principle of opening/closing is to open the extension and disable the modification. When the program needs to be expanded, the original code cannot be modified, but the original code must be extended to achieve a hot swapping effect. The reason for this principle is to make the program scalable, easy to maintain and upgrade. To achieve this, we need to use interfaces and abstract classes.
Object-oriented thinking is the basis of the design model

There are many child classes involved in the pattern. After reading this document, we have selected several representative design patterns (frequently used ones marked as bold above) to discuss and learn. This is a general analysis. In the future, we will discuss in detail each design mode and give an example for verification.

 

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.