O'Reilly logo

Design Patterns Explained: A New Perspective on Object-Oriented Design, Second Edition by Alan Shalloway, James R. Trott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 17. The Decorator Pattern

Overview

This chapter concludes the e-commerce case study introduced in Chapter 9, “The Strategy Pattern.”

This chapter

•   Describes a new requirement for the case study: Add header and footer information to the printed sales ticket.

•   Shows how the Decorator pattern handles the requirement flexibly.

•   Discusses how the Decorator pattern can be used to handle input/output (especially Java I/O).

•   Describes the key features of the Decorator pattern.

•   Describes some of my experience using the Decorator pattern in practice.

•   Describes how the essence of the Decorator pattern is not a linked list, but a collection of optional, decorating objects.

A Little More Detail

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required