December 2018
Intermediate to advanced
465 pages
8h 5m
English
Class hierarchies are a fundamental feature of object-oriented programming languages. Chapter 3 examined their capabilities. This chapter examines their (often significant) limitations and introduces the more flexible concept of a strategy hierarchy. Strategy hierarchies are a central component of several design techniques. This chapter examines two such techniques—the strategy pattern and the command pattern—and their uses.
Let’s begin by reviewing the template pattern from Chapter 3. In it, an abstract class (known as the template) provides a skeletal implementation of each public method, ...