This chapter covers the Decorator pattern, which is also known as the Wrapper pattern.
GoF Definition
It attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
Concept
An alternative to inheritance is composition. It is quite common in programming and often gives you a better payoff. This chapter shows a useful case study on this topic using some wrappers.
So, what is a wrapper(or a decorator)? A wrapper is like a topping that surrounds ...