code precipitation

1. If a code fragment is abstract, it means that it can have multiple implementations, then the diversity brought by abstraction should be considered;
2. Function refers to the execution process, and class variables or stack variables, In a sense, it refers to the heap or memory or data structure;
often there are many kinds of functions, and the data structure is basically fixed; for
example, in MAP, HASHMAP, TREEMAP, and MAP only define behavior, The data structure is delayed to be defined in the implementation class. According to different data structures, there are different behaviors corresponding to it. In other words, in reality, if there are different data, the code implementation of the same behavior is different;

3. The bridge pattern is a typical design pattern in which abstraction and implementation are separated. The abstract part is not extended

. 4. Focus on abstract code writing, because the data structure does not change often, but the abstract behavior will often change or There are many forms. When considering its scalability, consider several basic principles of the code (for example: the principle of opening and closing)

5. The design pattern should pay more attention to abstract processing

##Never forget, program = algorithm + data structure

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326431048&siteId=291194637