摘要:
Component是定义一个对象接口,可以给这些对象动态地添加职责。ConcreteComponent是定义了一个具体的对象,也可以给这个对象添加一些职责。Decorator,装饰抽象类,继承了Component,从外类来扩展Component类得功能,但对于Component来说,是无需知道Decorator的存在的。至于ConcreteComponent就是具体的装饰对象,起到给Component添加职责的功能。 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 class Co 阅读全文
posted @ 2011-12-15 22:21
麻烦V
阅读(165)
评论(0)
推荐(0)

浙公网安备 33010602011771号