A summary of personal thoughts on learning design patterns

Source: Internet
Author: User


1. It is the first to determine the change in demand in the constant

2, the unchanging thing is to be determined first,
And those things that are most able to change are logically abstract, the highest abstraction is the best interface,

The core of the idea is to become something you'd better abstract out first, then how it will be changed into further refinement, to leave some room for it to be used for later changes

Design patterns may be better when some requirements are more certain, or for some of the more definite scenarios,
But he could not use it for a one-time success of frequent changes in user needs


Personal Learning Experience:
1. In fact, the 23 design mode is to reach a closed-closing principle (open for expansion, to close the changes)
That is, a software entity can refer to a software module, a local structure consisting of multiple classes to form a separate class
However, demand changes over time as software system "requirements" change over time. ()
In order to satisfy the opening and closing principle, in order to facilitate the extension of the system, the extension is not necessary to modify the existing code, in order to have the adaptability and flexibility, good stability and disordered continuity in the software system.

Abstract design of the system is the key to the opening and closing principle. The system defines a relatively stable abstraction layer, and the different implementation behavior is accomplished in the concrete implementation.
At the same time, it is possible to encapsulate the variable factors by encapsulating the principle of "variability". And it's: Try not to talk about a variability mixed with another variability
, this will cause the number of classes in the system to increase the number of urgent, increase the complexity of the system.
This allows a system to have a good spread of the war and flexibility.

Of course, the principle of opening and closing is very difficult to achieve, as far as possible to follow this principle.

A summary of personal thoughts on learning design patterns

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.