
设计模式
五彩铅笔
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
设计模式 抽象工厂模式(Abstract Factory Pattern)
抽象工厂模式目的结构应用结论目的提供一个接口用于创建没有指定具体的类的相关或依赖对象 。结构AbstractFactory : 声明一个接口创建抽象产品对象的操作。ConcreteFactory :实现创建具体产品对象的操作。AbstractProduct : 声明一个接口类型的产品对象。ConcreteProduct翻译 2015-11-16 10:02:24 · 532 阅读 · 0 评论 -
设计模式 适配器模式(Adater Pattern)
适配器模式目的结构应用结论源码目的转换一个类的接口到客户想要的另一个接口。适配器允许类一起工作,否则无法工作,因为接口不兼容。结构 Target : 定义客户使用的指定接口.Client : 客户端.Adaptee : 定义一个需要适配的接口.Adapter : 适配被适配者并实现接口.应用你想要使用一个现有的类翻译 2015-11-16 13:46:27 · 464 阅读 · 0 评论 -
设计模式 桥接模式(Bridge Pattern)
Bridge 目的结构应用结论目的Decouple an abstraction from its implementation so that the two can vary independently.结构 Abstraction : Defines the abstraction's interface.RefinedAbstraction原创 2015-11-16 15:03:12 · 371 阅读 · 0 评论 -
设计模式 单例模式(Singleton Pattern)
单例模式(Singleton Pattern)目的确保一个类只有一个实例,提供一个全局访问接口。结构单例: defines an Instance operation that lets clients access its unique instance. Instance is a class operation (that is, a class原创 2015-12-11 13:57:08 · 340 阅读 · 0 评论 -
c++ 内存管理
c++内存管理方法使用较多的是 引用计数 内存管理方法。这里介绍另外一种内存管理的方法。#include #undef new#undef deleteclass CHeapOperators{public: static void* operator new( size_t size ); static void ope原创 2015-11-16 17:40:20 · 353 阅读 · 0 评论 -
设计模式 创建者模式(Builder Pattern)
创建者模式目的结构交互应用结论目的Separate the construction of a complex object from its representation so that the same construction process can create different representations.结构 Builde翻译 2015-11-17 10:25:06 · 391 阅读 · 0 评论 -
设计模式 职责链模式(Chain of Responsibility Pattern)
Chain of Responsibility目的构造应用结论目的禁止请求发送者同多个接收者的耦合。接收者链不断传递请求直到能够解决请求。构造Handler : 定义一个处理请求的接口. ConcreteHandler : 处理它负责的请求,可以传递到下一个接收者。如果它可以处理该请求,则不会传递到下一个接收者,否则相反。Client翻译 2015-12-03 11:12:28 · 385 阅读 · 0 评论