Continue to organize the contents of this book: the 11th Chapter system
This chapter feels more emphasis on the Java language itself, so do not do too much summary, in short, for the system as a whole, you can use the appropriate pattern design, to ensure the flexibility of the system, quoting part of the original text of the summary language:
The system should be neat. At all levels of abstraction, intentions should be clearly discernible. Whether you're designing a system or a separate module, don't forget to use the simplest solution that probably works. The 12th chapter is iterated into
There are four tips to help us create well-designed software that makes the design more "simple":
1. Run all tests.
2. Do not repeat.
3. Express the programmer's intentions.
4. Minimize the number of classes and methods.
The first is the basis and assurance of the following three, only the testable system is reliable and deployable, and writing well-run tests will be the goal of the system more closely aligned with the object-oriented, low-coupling high cohesion.
Two to four can be seen as the process of code refactoring: eliminate duplication, ensure code expression and readability, and, in this context, reduce the number of classes and methods. (For knowledge of refactoring, you can refer to Martin Fowler's refactoring: improving the design of existing code, which provides a detailed overview of refactoring-related knowledge.) )