這是Decorator模式的實現,其不採取繼承的方式,而以組合的方式動態地為物件添加功能。 以Python來實現的話: class FriedChicken: def getContent(self):
確定! 回上一頁