Overview

This chapter gives an initial solution to the problem discussed in Chapter 3, “A Problem That Cries Out for Flexible Code.” It is a reasonable first attempt at a solution and gets the job done quickly. However, it misses an important system requirement: flexibility as the CAD/CAM system continues to evolve.

In this chapter, I describe a solution based on object orientation. It is not a great solution, but it is a solution that would work.

Note: I will only show Java code examples in the main body of this chapter. The equivalent C++ code examples can be found at the end of this chapter.

Get Design Patterns Explained: A New Perspective on Object-Oriented Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.