Whip
Beverage beverage
getDescription() cost()
HouseBlend
cost()
Component
methodA()methodB()//其他方法
ConcreteDecoratorB
Component wrappedObjObject newState
Decaf
装饰者类继承组件抽象类,得到正确的类型,仍然是抽象类
Espresso
组件类通常是抽象类,可单独使用也可被装饰者包起来使用
Decorator
Milk
ConcreteComponent
DarkRoast
CondimentDecorator
getDescription()
Beverage
description
getDescription() cost()//其他有用的方法
Mocha
ConcreteDecoratorA
Component wrappedObj
methodA()methodB()newBehavior()//其他方法
Soy
具体组件类
具体装饰者类的行为来自装饰者和具体组件类