The Decorator pattern allows behavior to be added to individual objects dynamically at runtime without affecting other objects. This provides a flexible alternative to subclassing for extension. The pattern attaches additional responsibilities to an object dynamically through the composition of objects. For example, borders, scrollbars or other behaviors could be added to a text view component through multiple Decorator classes rather than requiring a large number of subclasses through inheritance. While this adds flexibility, Decorators are not identical to the component from an object identity perspective.