This chapter covers the Decorator pattern.
GoF Definition
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
Concept
From the GoF definition, it is evident that this pattern uses an alternative to subclassing (i.e., inheritance). If inheritance is not allowed, how do you proceed? Yes, you guessed it right. It prescribes you to use composition instead of inheritance.
By following the SOLID principle, this pattern promotes the concept where your class is closed for modification but open for ...