Which implementation method of the following two classes is better? Or are there other better solutions? Discuss discuss.
1. Start with each specific function and write all the functions of the class in one method. After the test passes, the entire function is divided into various methods of the class and tested again.
2. First write the overall structure of the class, and then fill in each function.
Which implementation method of the following two classes is better? Or are there other better solutions? Discuss discuss.
1. Start with each specific function and write all the functions of the class in one method. After the test passes, the entire function is divided into various methods of the class and tested again.
2. First write the overall structure of the class, and then fill in each function.
Object-oriented custom class