Advertisement

Decorators

  • Edward Sciore
Chapter

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.

Copyright information

© Edward Sciore 2019

Authors and Affiliations

  • Edward Sciore
    • 1
  1. 1.NewtonUSA

Personalised recommendations