软件设计模式C#Software Design Patterns in C#

设计模式( Design Patterns )是你在实际应用程序开发中,对不断发现的软件设计问题的重复解决方案。设计模式是关于对象的设计和交互,关于对经常出现的软件开发挑战的一些完美和重用的解决方案,也提供了一个交流平台,
 
“四人帮”( GOF )模式被认为是所有其他模式的基础, 23 种设计模式分为 3 类:创建型模式( Creational Pattern ),结构型模式( Structural Pattern )和行为型模式( Behavioral Pattern )。
 
为了让你先起步,这里提供了 2 种形式的源码:结构方面的( structural )和现实应用方法的( real-world )。结构方面的代码使用模式定义和 UML 类图中提供的类型名称,而实际应用方面的代码提供了你需要使用模式的真实设计情况。
 
   Creational Patterns 创建型模式
   Creates an instance of several families of classes
  Builder
   Separates object construction from its representation
   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
  Façade
   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 行为型模式
   A way of passing a request between a chain of objects
  Command
   Encapsulate a command request as an object
   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
   Defer the exact steps of an algorithm to a subclass
  Visitor
   Defines a new operation to a class without change
 
 
原英文 URL
 
上述各类模式的链接均提供了简单的解释、 UML 类图、 Structural code C# )和 Real-world code C# )。
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值