when Code is processed, we often find that many codes are similar and different. How can we find similarities and differences?
pre-processing first combines the parts that process the same logic code.
applicable environment:
1. when a Program is started, data must be processed in advance for display, the code for processing the data is very similar to the code generated by the user's operations on the interface. Merging two sections of code is imperative. Therefore, we need to distinguish different logics in the Code and perform preprocessing.
2. query with different conditions usually has a lot of code that is consistent.
example:
query: The number of work hours must be confirmed by Pl. Two confirmation functions are available. One is to confirm the selected row, one is to confirm all rows, confirm that a row of data is the same logic, and confirm which row of data is different logic. Therefore, we need to separate the data into a function.