定义:The Decorator Pattern attaches additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
一句话:Subclass里面有一个base class的object以及一些额外的object,这样这些额外的object就成了base class的decoration。
类比:滚雪球
一句话:Subclass里面有一个base class的object以及一些额外的object,这样这些额外的object就成了base class的decoration。
类比:滚雪球