結構型模式-裝飾模式

裝飾模式 動態地給一個對象添加一些額外的職責。就增加功能來說,裝飾器模式相比生成子類更爲靈活 裝飾模式的UML圖: 例子 抽象構件類、具體構件類 class Phone { public: virtual void Show() = 0; }; class Iphone :public Phone { public: Iphone(string type) { m_type = ty
相關文章
相關標籤/搜索