設計模式(C#) - 訪問者模式(Visitor Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹表示一個作用於某對象結構中的各元素的操作。它使你可以在不改變各元素的類的前提下定義作用於這些元素的新操作。示例有一個M
設計模式(C#) - 訪問者模式(Visitor Pattern)(2)
MessageModelusing System;using System.Collections.Generic;using System.Text;nam
設計模式(C#) - 訪問者模式(Visitor Pattern)(5)
AbstractVisitorusing System;using System.Collections.Generic;using System.Text;
設計模式(C#) - 訪問者模式(Visitor Pattern)(6)
Messagesusing System;using System.Collections.Generic;using System.Text;namespa
設計模式(C#) - 模板方法模式(Template Method Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹定義一個操作中的算法的骨架,而將一些步驟延遲到子類中。Template Method使得子類可以不改變一個算法的結構即
設計模式(C#) - 模板方法模式(Template Method Pattern)(2)
AbstractMessageTemplateusing System;using System.Collections.Generic;using Syst
設計模式(C#) - 模板方法模式(Template Method Pattern)(3)
SqlMessageusing System;using System.Collections.Generic;using System.Text;names
設計模式(C#) - 策略模式(Strategy Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹定義一系列的算法,把它們一個個封裝起來,並且使它們可相互替換。本模式使得算法的變化可獨立於使用它的客戶。示例有一個Me
設計模式(C#) - 策略模式(Strategy Pattern)(2)
IMessageStrategyusing System;using System.Collections.Generic;using System.Text
設計模式(C#) - 策略模式(Strategy Pattern)(3)
XMLMessageusing System;using System.Collections.Generic;using System.Text;names
設計模式(C#) - 狀態模式(State Pattern)(2)
MessageModelusing System;using System.Collections.Generic;using System.Text;nam
設計模式(C#) - 狀態模式(State Pattern)(3)
XMLMessageusing System;using System.Collections.Generic;using System.Text;names
設計模式(C#) - 狀態模式(State Pattern)(4)
SqlMessageusing System;using System.Collections.Generic;using System.Text;names
設計模式(C#) - 狀態模式(State Pattern)(5)
clIEntusing System;using System.Data;using System.Configuration;using System.Co
設計模式(C#) - 備忘錄模式(Memento Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹在不破壞封裝性的前提下,捕獲一個對象的內部狀態,並在該對象之外保存這個狀態。這樣以後就可將該對象恢復到保存的狀態。示例
設計模式(C#) - 備忘錄模式(Memento Pattern)(2)
MessageModelCaretakerusing System;using System.Collections.Generic;using System
設計模式(C#) - 備忘錄模式(Memento Pattern)(3)
Testusing System;using System.Data;using System.Configuration;using System.Coll
設計模式(C#) - 中介者模式(Mediator Pattern)(1)
返回“設計模式(C#)系列文章索引”介紹用一個中介對象來封裝一系列的對象交互。中介者使各對象不需要顯式地相互引用,從而使其耦合松散,而且可以獨立地改變它們之間