In this chapter, we are going to get back to a high-level view of programming and Java programming in particular. We will show the role of design in the process of a software system, starting with the earliest feasibility phase, going through high-level design, detailed design, and ending with the coding and testing. We will discuss the criteria for a good design and provide a guide to the well-proven OOD principles. The discussion will be illustrated by code examples that demonstrate the application of the main OOD principles.
In this chapter, we will cover the following topics:
- What is the purpose of design?
- Encapsulating and programming to an interface
- Taking advantage of polymorphism
- Decoupling as much as you can
- Preferring aggregation over inheritance
- So many OOD principles and so little time
- Single Responsibility Principle
- Open Closed...