The decorator pattern allows us to add behaviors to objects without changing their structure or inheritance chain. Instead of subclassing, decorators enhance an object's behavior by adding functionalities to it.
Unlike with inheritance, where the chain is directional, the decorator pattern allows for composing behaviors without regard to a particular execution order.
In this section, we'll explain the implementation details of the decorator pattern through the example of assembling a burger to your taste.