"Java Design Patterns"---general provisions

Source: Internet
Author: User

General principles of Design patternsI. Overview1, what is the design mode

Design Patterns are a set of reusable, most known, categorized purposes, code design experience Summary.

Explained below:

Classification and cataloging : it is said that some features can be found to divide these design patterns, so as to classify.

Code Design Experience : This sentence is very important, design experience summary, that is to say, design patterns, is to guide the design and from experience summed up the routines.

second, the design pattern of three major categories

The first three categories are: create mode, structural mode, behavioral mode three modes.

1. Understand the three categories

(1) A little explanation

Create Pattern: Object Instantiation mode, create pattern for decoupling object instantiation process.

structured pattern : Combining classes or objects together to form a larger structure.

Behavioral Patterns : How classes and objects interact, and divide responsibilities and algorithms.

Such an explanation, even I actually did not really understand what they mean. The large majority of the Internet to their interpretation on this floor, fortunately I found a more detailed introduction.

(2) Explain in more detail the following

Create pattern

The create pattern abstracts the instantiation of a class, separating the creation of objects from the software module and the use of objects . In order to make the software structure clearer, the outside world only needs to know their common interface, but not the specific implementation details, so that the whole system

Design more in line with the principle of single responsibility.

Structural mode

A structured pattern describes how to combine classes or objects together to form larger structures, like building blocks that can form complex, more powerful structures through the combination of simple bricks .

Behavioral Patterns

behavioral patterns are the abstraction of dividing responsibilities and algorithms between different objects. Behavioral patterns focus not only on the structure of classes and objects, but also on their interactions .

By using behavioral patterns, you can more clearly divide the responsibilities of classes and objects. When the system is running, objects are not orphaned, they can accomplish some complex functions by communicating and collaborating with each other, and one object at run time will also affect the operation of other objects.

This is finally a little bit clear.

2. Design Pattern Division

The content of this blog is still very little, the intention of the six principles also written in this blog, and finally found that the six principles are very important, understand that they are very helpful in the development of the usual to improve their code quality, so intend to write a separate blog detailed analysis.

Think too much, do too little, the middle of the gap is trouble. Want to have no trouble, either don't think, or do more. Lieutenant Colonel "3"

"Java Design Patterns"---general provisions

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.