摘要: 【1】什么是访问者模式? 今天学习访问者模式,访问者模式是A对象访问B对象的一种模式。非也。 那么,何谓访问者模式呢?真难理解!因为这个名字就TMD超晦涩,让人听不懂,或许只是此名称本身有且仅有的一个抽象意义而已。 何谓抽象意义呢?如果你理解了《类的概念》大概你才会有所参透。 我一直理解:抽象是多态 阅读全文
posted @ 2014-09-04 22:34 kaizenly 阅读(1292) 评论(0) 推荐(0)
摘要: 【1】什么是解释器模式? 解释器模式:拟定一种 “语言”,定义该语言文法的一种表示,并定义一种解释器,这个解释器使用该表示文法来解释语言中的句子。 【2】解释器模式代码示例: (1)代码示例1: 1 #include <iostream> 2 #include <list> 3 #include < 阅读全文
posted @ 2014-09-04 22:23 kaizenly 阅读(277) 评论(0) 推荐(0)
摘要: 【1】什么是享元模式? 享元模式: 【2】享元模式的代码示例: 代码示例1: 1 #include <iostream> 2 #include <string> 3 #include <map> 4 using namespace std; 5 6 class Flyweight 7 { 8 pub 阅读全文
posted @ 2014-09-04 21:54 kaizenly 阅读(260) 评论(0) 推荐(0)
摘要: 【1】什么是中介者模式? 中介者模式: 【2】中介者模式代码示例: 代码示例: 1 #include<iostream> 2 #include <string> 3 using namespace std; 4 5 class Mediator; 6 class ConcreteColleague1 阅读全文
posted @ 2014-09-04 21:20 kaizenly 阅读(250) 评论(0) 推荐(0)
摘要: 【1】什么是责任链模式? 责任链模式: 【2】责任链模式的代码示例: 代码示例: 1 #include<iostream> 2 #include<string> 3 using namespace std; 4 5 class Request 6 { 7 public: 8 string reque 阅读全文
posted @ 2014-09-04 19:57 kaizenly 阅读(355) 评论(0) 推荐(0)
摘要: 【1】什么是命令模式? 命令模式: 【2】命令模式的代码示例: 代码示例: 1 #if 0 2 3 #include <iostream> 4 #include <string> 5 using namespace std; 6 7 /* 8 * 运算基类 9 */ 10 class Operati 阅读全文
posted @ 2014-09-04 18:17 kaizenly 阅读(809) 评论(0) 推荐(0)
摘要: 【1】什么是桥接模式? 【2】桥接模式的代码示例 示例代码: 1 #include <iostream> 2 #include <string> 3 using namespace std; 4 5 class HandsetSoft 6 { 7 public: 8 virtual void run 阅读全文
posted @ 2014-09-04 18:04 kaizenly 阅读(343) 评论(0) 推荐(0)
打赏