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