A program consists of two parts: a function of data and operation data;
The process-oriented design approach is the Top-down function decomposition,
Decompose a requirement into multiple subfeatures, develop subfeatures and unit tests, and assemble them into a complete application;
Problem:
1. The program focuses on functions, followed by data, and data flows from one function to another function;
2. Data structure needs to run through multiple functions;
3. Modify the data structure, will cause the chain reaction in the procedure;
4. Data integrity error, may occur in multiple functions, there are bugs, not easy to find;
The object-oriented design method is the design object, the main improvement:
1. The main concern data structure, second is the function;
2. The data structure is encapsulated in the object, only needs to be used by the object;
3. Change the data structure, only need to modify the internal structure of the object, does not produce a chain reaction;
4. Each object is responsible for ensuring the integrity of their data, isolate bugs;
Object-oriented solves the problem of process-oriented.
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/Java/