Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
动态地为一个对象添加职责。 该模式为扩展现有类的功能提供了一种比继承更灵活的替代方案。
Component
) Request()
)。ConcreteComponent
) Decorator
) Request()
)。StateDecorator
, BehaviorDecorator
) addedState
),又可以添加行为 (AddedOperation
)。