随笔分类 -  设计模式

上一页 1 2

Factory Pattern
摘要:1.Factory模式两个最重要的功能(1)定义创建对象的接口,封装了对象的创建。(2)使得具体化类的工作延迟到了子类中。2.Factory模式结构示意图3.实现 1 #ifndef _PRODUCT_H_ 2 #define _PRODUCT_H_ 3 4 class Product 5 { 6... 阅读全文

posted @ 2015-07-16 16:31 那个人好像一条狗 阅读(126) 评论(0) 推荐(0)

Prototype Pattern
摘要:prototype 模式结构图:实现: 1 #ifndef _PROTOTYPE_H_ 2 #define _PROTOTYPE_H_ 3 4 class Prototype 5 { 6 public: 7 virtual ~Prototype(); 8 virtual Proto... 阅读全文

posted @ 2015-07-16 11:49 那个人好像一条狗 阅读(189) 评论(0) 推荐(0)

SingleTon Pattern
摘要:1 #ifndef _SINGLETON_H_ 2 #define _SINGLETON_H_ 3 4 #include 5 using namespace std; 6 7 class Singleton 8 { 9 public:10 static Singleton* Ins... 阅读全文

posted @ 2015-07-15 15:04 那个人好像一条狗 阅读(158) 评论(0) 推荐(0)

上一页 1 2