Overview
This chapter continues the e-tailing case study introduced in Chapter 14, “The Strategy Pattern.”
In this chapter,
I describe a new requirement for the case study: Add header and footer information to the printed sales ticket.
I show how the Decorator pattern handles the requirement flexibly.
I discuss how the Decorator pattern can be used to handle input/output (especially Java I/O).
I describe the key features of the Decorator pattern.
I describe some of my experience using the Decorator pattern in practice.
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.