![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
GOF Design Patterns
文章平均质量分 77
VioletHill
我的脚步一直没有停歇 因为心始终向着远方
展开
-
Visitor(访问者模式)
定义:the visitor design pattern is a way of separating an algorithm from an object structure on which it operates. A practical result of this separation is the ability to add new operations to existing原创 2014-04-29 14:44:30 · 517 阅读 · 0 评论 -
Singleton(单例模式)
定义:the singleton pattern is a design pattern that restricts the instantiation of a class to one object保证一个类仅有一个实例,并提供一个访问它的全局访问点。单例模式应该是所有设计模式中最简单的一个了,相信不少人也都用过。我第一次接触到单例模式是在cocos2d中,cocos2d中大原创 2014-04-28 22:01:12 · 414 阅读 · 0 评论 -
Prototype(原型模型)
定义:用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象。原创 2014-04-26 18:46:02 · 1105 阅读 · 0 评论 -
State(状态模式)
定义:Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.原创 2014-04-28 17:12:15 · 518 阅读 · 0 评论 -
Template Method(模板方法)
定义:Define the skeleton of an algorithm in an operation, deferring some steps to subclasses.原创 2014-04-25 17:14:12 · 430 阅读 · 0 评论 -
Strategy(策略模式)
定义:The Strategy Pattern defines a family of algorithms,encapsulates each one,and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.原创 2014-04-26 13:43:30 · 371 阅读 · 0 评论 -
Proxy(代理模式)
定义:provide a surrogate or placeholder for another object to control access to it 为其他对象提供一种代理以控制对这个对象的访问原创 2014-05-09 15:00:52 · 460 阅读 · 0 评论 -
Decorator(装饰着模式)
定义:Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.原创 2014-05-03 15:55:00 · 454 阅读 · 0 评论 -
Composite(组合模式)
定义:Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly原创 2014-04-30 15:06:16 · 432 阅读 · 0 评论 -
Builder(建造者模式)
定义:The intent of the Builder design pattern is to separate the construction of a complex object from its representation. By doing so, the same construction process can create different representations原创 2014-04-27 17:41:22 · 416 阅读 · 0 评论