摘要:
装饰模式, 动态地给一个对象添加一些额外的职责,就增加功能来说,装饰模式比生成子类更为灵活。// 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 阅读全文