裝飾模式C++實現

今天學習了下裝飾模式,親自用C++實現了下,感受最大的好處在於各個裝飾器能夠靈活的組合。UML圖以下:ios 代碼實現以下:學習 /* 測試裝飾模式實現方法 */ #include <iostream> #include <string> using namespace std; /* 基類接口 */ class Component { public:     virtual void oper
相關文章
相關標籤/搜索