A problem is often too complex to deal with as a single unit. A general approach is to divide the problem into smaller problems that are easier to solve. The partitioning of a problem into smaller parts is known as decomposition. These small parts are called modules, which are easier to manage.
Program design usually emphasizes modular structuring, also called modular decomposition. A problem is divided into smaller problems (or subproblems), and a solution is designed for each subproblem. Therefore, the solution to a problem consists of several smaller solutions corresponding to each of the subproblems. This approach is called modular design. Object-oriented design enhances modular design by providing classes as the most important decomposition (modular) unit. As an example, Figure 4.2 shows a program that consists of four modules.
Figure 4.2: General structure of program.