裝飾模式 C++實現

裝飾模式 ​ 裝飾模式(Decorator),動態地給一個對象添加一些額外的職責,就增加功能來說,裝飾者模型比生成子類更爲靈活。 #include <iostream> #include<string> using namespace std; //"Person"類(concretetcomponent) class Person { public:
相關文章
相關標籤/搜索