C# 設計模式:中介者模式具體同事類別實作 (5/5)
具體同事:SqlMessage 實作抽象同事介面,提供 SQL 訊息處理邏輯: using System; using System.Collections.
C# 設計模式:迭代器模式介紹與基礎實體類別 (1/4)
迭代器模式 (Iterator Pattern) 核心概念 定義:提供一種方法順序存取一個聚合物件中各個元素,而又不需暴露該物件的內部表示。 應用場景示例 有
C# 設計模式:迭代器模式迭代器介面與具體實作 (3/4)
迭代器介面:IIterator 定義標準遍歷操作契約: using System; using System.Collections.Generic; usi
C# 設計模式:迭代器模式完整測試與步長驗證 (4/4)
客戶端測試程式碼 展示迭代器遍歷集合,支援自訂步長: using System; using System.Data; using System.Config
C# 設計模式:解釋器模式介紹與架構圖解 (1/5)
解釋器模式 (Interpreter Pattern) 核心概念 定義:給定一個語言, 定義它的文法的一種表示,並定義一個解釋器,該解釋器使用該表示來解釋語言中
C# 設計模式:解釋器模式上下文與抽象運算式 (3/5)
上下文:Context 儲存解釋過程中的輸入與輸出狀態: using System; using System.Collections.Generic; us
C# 設計模式:解釋器模式資料庫與物件終端運算式 (4/5)
終端運算式:DatabaseExpression 解析大括號語法,映射資料庫類型: using System; using System.Collection
C# 設計模式:解釋器模式完整測試與動態執行驗證 (5/5)
終端運算式:MethodExpression 解析方法相關語法(括號內容),映射至 .NET 方法呼叫: using System; using System
C# 設計模式:命令模式介紹與基礎實體類別 (1/5)
命令模式 (Command Pattern) 核心概念 定義:將一個請求封裝為一個物件,從而使你可用不同的請求對客戶進行參數化;對請求排隊或記錄請求日誌,以及支
C# 設計模式:命令模式動作列舉與接收者實作 (2/5)
動作列舉:Action 定義可封裝為命令的操作類型: using System; using System.Collections.Generic; usin
C# 設計模式:命令模式命令介面與具體命令實作 (3/5)
命令介面:ICommand 定義命令執行與撤銷的標準契約: using System; using System.Collections.Generic; u
C# 設計模式:命令模式請求者與歷史管理 (4/5)
請求者:Message (Invoker) 封裝命令執行、撤銷、重做邏輯,維護命令歷史: using System; using System.Collect
C# 設計模式:迭代器模式集合介面與實作 (2/4)
集合介面:ICollection 定義建立迭代器的標準介面: using System; using System.Collections.Generic;
C# 設計模式:責任鏈模式介紹與架構圖解 (1/5)
責任鏈模式 (Chain of Responsibility Pattern) 核心概念 定義:為解除請求的發送者和接收者之間耦合,而使多個物件都有機會處理這個
C# 設計模式:責任鏈模式基礎實體與 SQL 執行類別 (2/5)
資料實體:MessageModel 責任鏈中傳遞的請求資料: using System; using System.Collections.Generic;
C# 設計模式:責任鏈模式抽象處理者與員工處理者 (3/5)
抽象處理者:AbstractExecutor 定義處理者介面與鏈結管理: using System; using System.Collections.Gen
C# 設計模式:責任鏈模式主管與經理處理者實作 (4/5)
具體處理者:Leader (主管) 處理長度 5-9 字元的訊息,否則傳遞給上級: using System; using System.Collection
C# 設計模式:責任鏈模式完整測試與執行結果 (5/5)
客戶端測試程式碼 建立責任鏈:員工 → 主管 → 經理,根據訊息長度決定處理層級: using System; using System.Data; usin