Abstract
A decorator is a wrapper that implements the same interface as the object it wraps. Decorator methods enhance the methods of the wrapped object, in contrast to adapter methods, which replace the methods of the wrapped object. Moreover, an object can be decorated multiple times, with each decorator providing its own enhancement. This chapter examines several useful applications of decorators.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Edward Sciore
About this chapter
Cite this chapter
Sciore, E. (2019). Decorators. In: Java Program Design. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4143-1_8
Download citation
DOI: https://doi.org/10.1007/978-1-4842-4143-1_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-4142-4
Online ISBN: 978-1-4842-4143-1
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)