設計模式(C#) - 適配器模式(Adapter Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹將一個類的接口轉換成客戶希望的另外一個接口。Adapter模式使得原本由於接口不兼容而不能一起工作的那些類可以一起工作
設計模式(C#) - 適配器模式(Adapter Pattern)(2)
SqlMessageusing System;using System.Collections.Generic;using System.Text;names
設計模式(C#) - 適配器模式(Adapter Pattern)(3)
Messageusing System;using System.Collections.Generic;using System.Text;namespac
設計模式(C#) - 單例模式(Singleton Pattern)
返回“設計模式(C#)系列文章索引”介紹保證一個類僅有一個實例,並提供一個訪問它的全局訪問點。示例保證一個類僅有一個實例。Singletonusing Sys
設計模式(C#) - 工廠方法模式(Factory Method Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹定義一個用於創建對象的接口,讓子類決定將哪一個類實例化。Factory Method使一個類的實例化延遲到其子類。示例
設計模式(C#) - 工廠方法模式(Factory Method Pattern)(2)
MessageModelusing System;using System.Collections.Generic;using System.Text;nam
設計模式(C#) - 工廠方法模式(Factory Method Pattern)(3)
SqlMessageusing System;using System.Collections.Generic;using System.Text;names
設計模式(C#) - 工廠方法模式(Factory Method Pattern)(4)
AbstractMessageFactoryusing System;using System.Collections.Generic;using Syste
設計模式(C#) - 原型模式(Prototype Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹用原型實例指定創建對象的種類,並且通過拷貝這個原型來創建新的對象。示例有一個Message實體類,現在要克隆它。Mes
設計模式(C#) - 原型模式(Prototype Pattern)(2)
ShallowCopyusing System;using System.Collections.Generic;using System.Text;name
設計模式(C#) - 原型模式(Prototype Pattern)(3)
clIEntusing System;using System.Data;using System.Configuration;using System.Co
設計模式(C#) - 建造者模式(Builder Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹將一個復雜對象的構建與它的表示分離,使得同樣的構建過程可以創建不同的表示。示例用同樣的構建過程創建Sql和XML的In
設計模式(C#) - 建造者模式(Builder Pattern)(2)
MessageModelusing System;using System.Collections.Generic;using System.Text;nam
設計模式(C#) - 建造者模式(Builder Pattern)(3)
XMLMessageusing System;using System.Collections.Generic;using System.Text;names
設計模式(C#) - 建造者模式(Builder Pattern)(4)
AbstractMessageBuilderusing System;using System.Collections.Generic;using Syste
設計模式(C#) - 建造者模式(Builder Pattern)(5)
XMLMessageBuilderusing System;using System.Collections.Generic;using System.Tex
設計模式(C#) - 觀察者模式(Observer Pattern)(2)
MessageModelusing System;using System.Collections.Generic;using System.Text;nam
設計模式(C#) - 觀察者模式(Observer Pattern)(3)
SqlMessageusing System;using System.Collections.Generic;using System.Text;names