<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_Clingingboy_分类_设计模式</title><id>http://feed.cnblogs.com/blog/u/16497/category/259215/rss</id><updated>2012-05-27T02:38:20Z</updated><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/category/259215.html"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/16497/category/259215/rss"/><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809598.html</id><title type="text">访问者模式(Visitor Pattern)</title><summary type="text">意图：表示一个作用于某对象结构中的各元素的操作。它使你可以在不改变各元素的类的前提下定义作用于这些元素的新操作。</summary><published>2010-08-26T15:11:00Z</published><updated>2010-08-26T15:11:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809598.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809598.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809596.html</id><title type="text">责任链模式(Chain of Responsibility Pattern)</title><summary type="text">意图:为解除请求的发送者和接收者之间耦合，而使多个对象都有机会处理这个请求。将这些对象连成一条链，并沿着这条链传递该请求，直到有一个对象处理它。</summary><published>2010-08-26T15:11:00Z</published><updated>2010-08-26T15:11:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809596.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809596.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809595.html</id><title type="text">命令模式(Command Pattern)</title><summary type="text">using System; class CommandPattern { // Command Pattern Judith Bishop June 2007 // // Uses a single delegate for the single type of commands that the client invokes. delegate void Invoker (); static I...</summary><published>2010-08-26T15:10:00Z</published><updated>2010-08-26T15:10:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809595.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809595.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809593.html</id><title type="text">状态模式(State Pattern)</title><summary type="text">意图：允许一个对象在其内部状态改变时改变它的行为。对象看起来似乎修改了它所属的类。</summary><published>2010-08-26T15:09:00Z</published><updated>2010-08-26T15:09:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809593.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809593.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809560.html</id><title type="text">单件模式</title><summary type="text">保证一个类仅有一个实例，并提供一个访问它的全局访问点。 1.示例1. 由于加了readonly关键字,所以只会在构造函数中初始化一次.2.延迟初始化 注意内部多定义了一个类这个模式平时用到的也最多,面...</summary><published>2010-08-26T14:25:00Z</published><updated>2010-08-26T14:25:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809560.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809560.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809558.html</id><title type="text">创建者模式</title><summary type="text">意图:将一个复杂的构建与其表示相分离，使得同样的构建过程可以创建不同的表示。 下面会发现模式实现方式与策略模式,桥接模式等都是相似的,唯有意图不同而已.此为创建者模式 创建者模式在平时生活中很常见,如...</summary><published>2010-08-26T14:24:00Z</published><updated>2010-08-26T14:24:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809558.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809558.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809556.html</id><title type="text">抽象工厂</title><summary type="text">提供一个创建一系列相关或相互依赖对象的接口，而无需指定它们具体的类 对于不同类产品提供一类工厂 1.产品接口2.工厂这里采用了泛型，所以会更灵活些 3.IBrand不同类产品信息4.对不同类产品创建不...</summary><published>2010-08-26T14:24:00Z</published><updated>2010-08-26T14:24:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809556.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809556.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809554.html</id><title type="text">工厂模式</title><summary type="text">定义一个用户创建对象的接口，让子类决定实例化哪一个 1.产品2.工厂 每个产品都有一个工厂3.客户端调用与工厂模式比较,这里每个产品都有工厂，虽有扩展性，但每个产品都有工厂也造成了麻烦</summary><published>2010-08-26T14:22:00Z</published><updated>2010-08-26T14:22:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809554.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809554.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809553.html</id><title type="text">简单工厂模式</title><summary type="text">一个静态类工厂 先定义具体接口和类2.静态工厂 这个方式很简单,缺点就是无法扩展,需要if else判断或者swich等判断。视具体情况而定</summary><published>2010-08-26T14:21:00Z</published><updated>2010-08-26T14:21:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809553.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809553.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809552.html</id><title type="text">策略模式</title><summary type="text">此模式意图在于切换算法,其实现方式与模板模式，桥接模式等是大同小异，或者可以说是相同，只有意图不同而已.初学设计模式都被这相似的代码，不同的模式搞混乱了。其实仅仅就是抽象而已。 1.接口与实现2.上下...</summary><published>2010-08-26T14:20:00Z</published><updated>2010-08-26T14:20:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809552.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809552.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809551.html</id><title type="text">模板模式</title><summary type="text">也是抽象与实现分离,其意图是定义一个模板,然后把具体实现交给子类完成. 1.接口2.实现3.调用 4.客户端调用 注意此模式与桥接模式很像，区别在于这里接口传值是是方法里实现的,这样就灵活一些.模板模...</summary><published>2010-08-26T14:19:00Z</published><updated>2010-08-26T14:19:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809551.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809551.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809549.html</id><title type="text">原型模式</title><summary type="text">分浅拷贝和深拷贝,值得注意的地方是浅拷贝无法复制引用类型 实现方法 浅拷贝:通过调用MemberwiseClone方法 深拷贝:通过序列化来实现 来看下面接口为了区分浅拷贝和深拷贝的区别，在对象中再定...</summary><published>2010-08-26T14:18:00Z</published><updated>2010-08-26T14:18:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809549.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809549.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809547.html</id><title type="text">享元模式</title><summary type="text">运用 单例+工厂来维护一组对象状态,并有效的减少对象实例化的数量 这个模式关键的实现在于这个工厂类 1.接口2.具体实现的类3.工厂 该类最好成为单例模式，否则这个模式就废掉了. 改进如下工厂可以有效...</summary><published>2010-08-26T14:17:00Z</published><updated>2010-08-26T14:17:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809547.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809547.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809545.html</id><title type="text">组合模式</title><summary type="text">将对象以部分-整体的形式组成,如画图,可以画圆,画线,然后组成一幅图片,与装饰部同的是，这里是组合，装饰是扩展,组合模式是一个行为了的整合。但其又统一了部分和整体操作接口的统一性. 接口整体对象Com...</summary><published>2010-08-26T14:16:00Z</published><updated>2010-08-26T14:16:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809545.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809545.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809542.html</id><title type="text">桥接模式</title><summary type="text">将抽象与实现分离在构造函数中传入接口，然后在Operation方法中调用接口方法 客户端调用 其实很简单,还是面向对象基础,不小心就成了一个模式</summary><published>2010-08-26T14:14:00Z</published><updated>2010-08-26T14:14:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809542.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809542.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809540.html</id><title type="text">适配器模式</title><summary type="text">适配器的意图是复用现有对象的功能. 这个模式用的还是比较多的.重新定义了一个Request方法,然后调用基类方法SpecificRequest (也可以不用继承，从内部实例化对象也可以,具体可灵活运用...</summary><published>2010-08-26T14:12:00Z</published><updated>2010-08-26T14:12:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809540.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809540.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809538.html</id><title type="text">外观模式（Fa&amp;ccedil;ade Pattern）</title><summary type="text">这个模式非常的简单，可以说称不上模式 打个比方，我们大部分时候运行源代码程序需要做一下几件事情,其实就是做封装,简化操作 打开IDE 打开项目 编译 运行 来看下面例子我需要调用这三个类来完...</summary><published>2010-08-26T14:10:00Z</published><updated>2010-08-26T14:10:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809538.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809538.html"/><content type="html"/></entry><entry><id>http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809536.html</id><title type="text">装饰模式</title><summary type="text">此模式采用组合非继承的方式来扩展对象职责. .net的应用中，如asp.net ajax的behavior,wpf和silverlight的附加属性,都可以认为是装饰模式的变体.但稍微有些变化.都起到了装饰的作用. 上面的uml图给予一个参考,但非死规定，理解思想就好，如接口也可以是抽象类. 来看一个关于图片的示例 1.定义组件基类(Component,缺省无接口),呈现一幅图片 2.添加图片边框...</summary><published>2010-08-26T14:06:00Z</published><updated>2010-08-26T14:06:00Z</updated><author><name>Clingingboy</name><uri>http://www.cnblogs.com/Clingingboy/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809536.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Clingingboy/archive/2010/08/26/1809536.html"/><content type="html"/></entry></feed>
