In this recipe, we will learn how to implement the decorator pattern, which provides the ability to extend the functionality of a class without the need for inheritance, which by design is static in nature. This recipe is important because inheritance doesn't support the ability to extend a class at runtime, a problem the decorator pattern addresses.