摘要: 装饰模式, 动态地给一个对象添加一些额外的职责,就增加功能来说,装饰模式比生成子类更为灵活。// Decorator.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <iostream>using namespace std;class IComponent{public:virtual void process() = 0;};class Component : public IComponent{public:virtual voi 阅读全文
posted @ 2011-12-01 17:31 Just a Programer 阅读(217) 评论(0) 推荐(0) 编辑