decorate 通过反复包含对像,并对已包含对象方法添加功能

Function:
      The decorator pattern can be used to make it possible to extend (decorate) the functionality of a class at runtime.
Actors:
      FunctionInterface, BasicFunctionClass, decorator, concreteDecorator
Summary
      FunctionInterface is to define decoratable method.
      BasicFunctionClass defines the basic functionality.
      Decorator is the core of  this design pattern, is has a FunctionInterface property.
      All ConcreteDecorators will overrite the method and patch new functionality to the overriden class.

      装饰模式之标准图
原文地址:https://www.cnblogs.com/kevinge/p/1546275.html