GOF Desing Pattern For C# (23)

原创 2006年06月04日 22:02:00

GOF Desing Pattern For C#



Design patterns are recurring solutions to software design problems you find again and again in real-world application development. Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges.

The Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral. Here you will find information on these important patterns.

To give you a head start, the C# source code is provided in 2 forms: 'structural' and 'real-world'. Structural code uses type names as defined in the pattern definition and UML diagrams. Real-world code provides real-world programming situations where you may use these patterns.

A third form, '.NET optimized' demonstrates design patterns that exploit built-in .NET 2.0 features, such as, generics, attributes, delegates, and reflection. These and much more are available in our Design Pattern Framework 2.0TM. For an example of a .NET 2.0 Optimized pattern see our Singleton page.

Creational Patterns
  Abstract Factory   Creates an instance of several families of classes
  Builder   Separates object construction from its representation
  Factory Method   Creates an instance of several derived classes
  Prototype   A fully initialized instance to be copied or cloned
  Singleton   A class of which only a single instance can exist

  Structural Patterns
  Adapter   Match interfaces of different classes
  Bridge   Separates an object’s interface from its implementation
  Composite   A tree structure of simple and composite objects
  Decorator   Add responsibilities to objects dynamically
  Facade   A single class that represents an entire subsystem
  Flyweight   A fine-grained instance used for efficient sharing
  Proxy   An object representing another object

  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 way to include language elements in a program
  Iterator   Sequentially access the elements of a collection
  Mediator   Defines simplified communication between classes
  Memento   Capture and restore an object's internal state
  Observer   A way of notifying change to a number of classes
  State   Alter an object's behavior when its state changes
  Strategy   Encapsulates an algorithm inside a class
  Template Method   Defer the exact steps of an algorithm to a subclass
  Visitor   Defines a new operation to a class without change


以文本和思维导图的方式简明扼要的介绍了GoF的23个经典设计模式,可当成学习设计模式的一个小手册,偶尔看一下,说不定会对大师的思想精髓有新的领悟。GoF(“四人帮”,又称Gang of Four,即E...
  • jiangfei009003
  • jiangfei009003
  • 2014年01月05日 15:13
  • 2860


创建型 1. Factory Method(工厂方法) 2. Abstract Factory(抽象工厂) 3. Builder(建造者) 4. Prototype(原型) 5. Singleton(...
  • zhangcanyan
  • zhangcanyan
  • 2016年06月28日 21:14
  • 7686


  • leelit
  • leelit
  • 2014年10月20日 14:27
  • 2046


比较   设计模式 常用程度 适用层次 引入时机 结构复杂度 Abstract Factory 比较常用 应用级 设计时 比较复杂 Builde...
  • q317379184
  • q317379184
  • 2015年08月18日 16:24
  • 484


三:构造型模式 (1)建造者模式也叫生成器模式(Builder) 1.建造者模式的意图是把构造对象实例的代码逻辑移到要实例化的类的外部 2.生成器模式将一个复杂对象的构建与它的表示分离,使得同样的构建...
  • leelit
  • leelit
  • 2014年10月20日 20:44
  • 1175

中介者模式 Mediator Pattern

一、什么是中介者模式     Mediator模式也叫中介者模式,是由GoF提出的23种软件设计模式的一种。Mediator模式是行为模式之一,在Mediator模式中,类之间的交互行为被统一放在M...
  • liuwenbo0920
  • liuwenbo0920
  • 2012年02月20日 14:59
  • 6889


简单工厂模式属于类的创新型模式,又叫静态工厂方法模式,是通过专门定义一个类来负责创建其他类的实例,被创建的实例通常都具有共同的父类。 —————————————————————————————————...
  • sunqingzhong44
  • sunqingzhong44
  • 2016年07月01日 10:01
  • 236


  • lk142500
  • lk142500
  • 2015年04月17日 21:42
  • 660

《设计模式》GoF(Gang of Four)

GoF(Gang of Four),中文名——四人组 发布时间:2009-10-11 21:25:46 技术类别:软件开发     小...
  • muzilanlan
  • muzilanlan
  • 2014年01月21日 01:29
  • 956

Desing Pattern

近来由于工作上的需要,用了两个来月的时间,对UML及设计模式一些书籍进行了阅读.让我颇有受益,不过还得继续努力. 一个月前离开了一家公司,当时公司准备做B/S结构的开发,以前一直用PB开发.对于PB来...
  • yxpjx
  • yxpjx
  • 2006年12月15日 23:47
  • 446
您举报文章:GOF Desing Pattern For C# (23)