Chapter 9. The Strategy Pattern

Overview

This chapter introduces a new case study, which comes from the area of e-commerce (electronic commerce over the Internet). It also begins a solution using the Strategy pattern. I return to this case study in Chapter 16, “The Analysis Matrix.”

This chapter

•   Returns to the problem of new requirements and describes approaches to handling new variations of an existing theme.

•   Explains which approach is consistent with the Gang of Four’s philosophy and why.

•   Introduces the new case study.

•   Describes the Strategy pattern and shows how it handles a new requirement in the case study.

•   Describes the key features of the Strategy pattern.

An Approach to Handling New Requirements ...

Get Design Patterns Explained: A New Perspective on Object-Oriented Design, Second Edition 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.