设计模式
文章平均质量分 92
爱因斯坦.薛
把最合适的产品以最合适的方式奉献给最合适的客户
展开
-
创建型模式总结
创建型模式列表 Abstract Factory Creates an instance of several families of classes Builder Separates object construction from its representation Factory Method Creates a原创 2009-06-25 14:44:00 · 1111 阅读 · 0 评论 -
设计模式15:Command Pattern (命令模式)
Define:Encapsulate a command request as an object一、 命令(Command)模式命令(Command)模式属于对象的行为模式【GOF95】。命令模式又称为行动(Action)模式或交易(Transaction)模式。命令模式把一个请求或者操作封装到一个对象中。命令模式允许系统使用不同的请求把客户端参数化,对请求排队或者记录请求日志,可以提供原创 2009-07-03 10:36:00 · 1154 阅读 · 0 评论 -
设计模式16:Interpreter Pattern(解释者模式)
本文翻译自:http://www.dofactory.com/Patterns/PatternInterpreter.aspxDefine:Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret se原创 2009-07-06 12:56:00 · 2217 阅读 · 0 评论 -
设计模式17:Observer Pattern (观察者模式)
Define:Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. 一、 观察者(Observer)模式观察者模式又叫做发布-订阅(Publish/Sub原创 2009-07-06 14:03:00 · 1118 阅读 · 0 评论 -
设计模式19:Template Method Pattern (模板方法模式)
Define:Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithms原创 2009-07-07 11:01:00 · 1284 阅读 · 0 评论 -
设计模式20:Strategy Pattern (策略模式)
Define:Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it. 一、 策略(Strategy)模式策略模式的用意是针对一组算法,原创 2009-07-07 11:24:00 · 1543 阅读 · 0 评论 -
设计模式18:Visitor Pattern (访问者模式)
Define:Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates. 一、 访原创 2009-07-07 10:34:00 · 947 阅读 · 0 评论 -
设计模式21:Iterator Pattern (迭代器模式)
可以查看英文原文:http://www.dofactory.com/Patterns/PatternIterator.aspx一、迭代器模式:Iterator PatternDefine:Provide a way to access the elements of an aggregate object sequentially without exposing its underlyi原创 2009-07-09 11:56:00 · 1346 阅读 · 0 评论 -
设计模式22:Mediator Pattern (调解者模式)
英文原文:http://www.dofactory.com/Patterns/PatternMediator.aspx一、Mediator Pattern (调解者模式)的定义Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keepin原创 2009-07-09 13:42:00 · 1911 阅读 · 0 评论 -
设计模式23:Memento Pattern (备忘录模式)
英文原文:http://www.dofactory.com/Patterns/PatternMemento.aspx一、Memento Pattern (备忘录模式)Define:Without violating encapsulation, capture and externalize an objects internal state so that the object can原创 2009-07-09 14:23:00 · 1396 阅读 · 0 评论 -
设计模式24:State Pattern (状态模式)
英文原文:http://www.dofactory.com/Patterns/PatternState.aspx一、State Pattern (状态模式)Define: Allow an object to alter its behavior when its internal state changes. The object will appear to change its cl原创 2009-07-09 14:43:00 · 1746 阅读 · 0 评论 -
Behavioral Patterns 行为模式总结
一、总体概念 Behavioral Patterns Chain of Resp. A way of passing a request between a chain of objects Command Encapsulate a command request as an object Interpreter A原创 2009-07-09 14:55:00 · 1783 阅读 · 0 评论 -
程序员技术练级攻略
今天看到一篇文章,有所感触,突然感觉自己要好好研究基础项目了。谢谢文章的作者。转发自:http://coolshell.cn/articles/4990.html月光博客6月12日发表了《写给新手程序员的一封信》,翻译自《An open letter to those who w转载 2011-07-25 17:01:00 · 1274 阅读 · 0 评论 -
设计模式14:Chain of Responsibility Pattern (职责链模式)
Define:Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an o原创 2009-07-03 10:15:00 · 1663 阅读 · 0 评论 -
结构模式(Structural Pattern)总结
结构模式(Structural Pattern)描述如何将类或者对象结合在一起形成更大的结构。结构模式描述两种不同的东西:类与类的实例。根据这一点,结构模式可以分为类的结构模式和对象的结构模式。具体的集中结构模式如下所示:Structural Patterns Adapter Match interfaces of different classes原创 2009-07-02 13:15:00 · 2212 阅读 · 0 评论 -
设计模式13:Bridge Pattern (桥梁模式)
Define:Decouple an abstraction from its implementation so that the two can vary independently. 一、 桥梁(Bridge)模式桥梁模式是一个非常有用的模式,也是比较复杂的一个模式。熟悉这个模式对于理解面向对象的设计原则,包括"开-闭"原则(OCP)以及组合/聚合复用原则(CARP)都很有帮助。理解原创 2009-07-02 10:08:00 · 2311 阅读 · 1 评论 -
设计模式1:Simple Factory Pattern(简单工厂模式)
原文:http://www.cnblogs.com/zhenyulu/articles/36462.html工厂模式专门负责将大量有共同接口的类实例化。工厂模式可以动态决定将哪一个类实例化,不必事先知道每次要实例化哪一个类。工厂模式有以下几种形态:简单工厂(Simple Factory)模式工厂方法(Factory Method)模式抽象工厂(Abstract Factory)模式原创 2009-06-24 17:54:00 · 1666 阅读 · 2 评论 -
设计模式2:Factory Method Pattern(工厂方法模式)
原文:http://www.cnblogs.com/zhenyulu/articles/36590.html参考资料:http://www.dofactory.com/Patterns/PatternFactory.aspx一、 工厂方法(Factory Method)模式工厂方法(FactoryMethod)模式是类的创建模式,其用意是定义一个创建产品对象的工厂接口,将实际创建工作推原创 2009-06-24 18:20:00 · 1272 阅读 · 0 评论 -
设计模式5:Builder Pattern(建造者模式)
出自于:http://www.cnblogs.com/zhenyulu/articles/37378.html参考:http://www.dofactory.com/Patterns/PatternBuilder.aspx一、 建造者(Builder)模式definition:Separate the construction of a complex object from its原创 2009-06-25 09:21:00 · 4220 阅读 · 0 评论 -
设计模式6:Adapter Pattern (适配器模式)
来自于:http://www.cnblogs.com/zhenyulu/articles/39386.html参考于:http://www.dofactory.com/Patterns/PatternAdapter.aspx一、 适配器(Adapter)模式适配器模式把一个类的接口变换成客户端所期待的另一种接口,从而使原本接口不匹配而无法在一起工作的两个类能够在一起工作。名称由来原创 2009-06-25 15:53:00 · 2606 阅读 · 0 评论 -
设计模式6:Prototype Pattern (原型模式)
出自于:http://www.cnblogs.com/zhenyulu/articles/39257.html参考于:http://www.dofactory.com/Patterns/PatternPrototype.aspx一、 原型(Prototype)模式Definition:Specify the kind of objects to create using a proto原创 2009-06-25 09:25:00 · 3088 阅读 · 0 评论 -
设计模式3:Abstract Factory Pattern(抽象工厂模式)
原文来自于:http://www.cnblogs.com/zhenyulu/articles/36885.html参考于:http://www.dofactory.com/Patterns/PatternAbstract.aspx一、 抽象工厂(Abstract Factory)模式抽象工厂模式是所有形态的工厂模式中最为抽象和最具一般性的一种形态。为了方便引进抽象工厂模式,引进一个原创 2009-06-25 09:14:00 · 1052 阅读 · 0 评论 -
设计模式4:Singleton Pattern (单例模式)
原文:http://www.cnblogs.com/zhenyulu/articles/37246.html参考于:http://www.dofactory.com/Patterns/PatternSingleton.aspx一、 单例(Singleton)模式单例模式的特点:单例类只能有一个实例。 单例类必须自己创建自己的唯一实例。 单例类必须给所有其它对象提供这一实原创 2009-06-25 09:19:00 · 2699 阅读 · 0 评论 -
设计模式8:Decorator Pattern (装饰模式)
来自于:http://www.cnblogs.com/zhenyulu/articles/46735.html参考于:http://www.dofactory.com/Patterns/PatternDecorator.aspxDefine:Attach additional responsibilities to an object dynamically. Decorators pro原创 2009-06-30 10:08:00 · 1202 阅读 · 0 评论 -
设计模式7:Composite Pattern (组合模式)
来自于:http://www.cnblogs.com/zhenyulu/articles/41829.html参考:http://www.dofactory.com/Patterns/PatternComposite.aspxDefine:Compose objects into tree structures to represent part-whole hierarchies. Co原创 2009-06-30 08:26:00 · 1538 阅读 · 0 评论 -
设计模式9:Proxy Pattern (代理模式)
Define:Provide a surrogate or placeholder for another object to control access to it. 一、 代理(Proxy)模式代理(Proxy)模式给某一个对象提供一个代理,并由代理对象控制对原对象的引用。代理模式的英文叫做Proxy或Surrogate,中文都可译成"代理"。所谓代理,就是一个人或者一个机构代表原创 2009-07-01 09:56:00 · 1484 阅读 · 0 评论 -
设计模式10:Flyweight Pattern (友元模式)
Use sharing to support large numbers of fine-grained objects efficiently. 一、 享元(Flyweight)模式Flyweight在拳击比赛中指最轻量级,即"蝇量级",有些作者翻译为"羽量级"。这里使用"享元模式"更能反映模式的用意。享元模式以共享的方式高效地支持大量的细粒度对象。享元对象能做到共享的关键是区分内蕴原创 2009-07-01 11:32:00 · 1266 阅读 · 0 评论 -
设计模式12:Facade Pattern (门面模式)
Define:Provide a unified interface to a set of interfaces in a subsystem. Façade defines a higher-level interface that makes the subsystem easier to use. 一、 门面(Facade)模式外部与一个子系统的通信必须通过一个统一的门面(Faca原创 2009-07-02 09:43:00 · 3399 阅读 · 0 评论 -
设计模式中类的关系
首先,感谢原创也支持原创的相关文章。原文地址:http://blog.csdn.net/zhengzhb/article/details/7187278在面向对象的世界中,不论是项目管理还是设计模式的学习,我们都可能用到UML图,原文一方面介绍了类与类之间的关系,同时还解释了这几类关系的细微差别,甚至从中可以看到类关系之间的几个容易混淆的概念和UML表述方式。在转载 2013-01-13 21:48:37 · 870 阅读 · 0 评论