Design Patterns in C# (Hardcover)
暫譯: C# 設計模式 (精裝版)

Steven John Metsker

  • 出版商: Addison Wesley
  • 出版日期: 2004-04-25
  • 售價: $2,560
  • 貴賓價: 9.5$2,432
  • 語言: 英文
  • 頁數: 480
  • 裝訂: Hardcover
  • ISBN: 0321126971
  • ISBN-13: 9780321126979
  • 相關分類: C#Design Pattern
  • 已絕版

買這商品的人也買了...

商品描述

For students learning in the Microsoft environment, this book is a companion to the original Design Patterns text tailored to the C#. This book is an application book, rather than a theoretical one. It is written for students who want to gain a better understanding of the patterns described in the seminal design patterns book by Gamma et al. The book's intent is to give students the confidence and know-how to apply the original 23 patterns identified in the Gamma book, with all code examples provided in C#.

Table of Contents:

Preface.

1. Introduction.

Why Patterns? Why Design Patterns? Why C#? UML. Challenges. The Organization of this Book. Welcome to Oozinoz! Summary.

I. INTERFACE PATTERNS.

2. Introducing Interfaces.

Interfaces and Abstract Classes. Interfaces and Delegates. Interfaces and Properties. Interface Details. Summary. Beyond Ordinary Interfaces.

3. Adapter.

Adapting to an Interface. Class and Object Adapters. Adapting Data in .NET. Summary.

4. Facade.

An Ordinary Facade. Refactoring to Facade. Facades, Utilities, and Demos. Summary.

5. Composite.

An Ordinary Composite. Recursive Behavior in Composites. Composites, Trees, and Cycles. Composites with Cycles. Consequences of Cycles. Summary.

6. Bridge.

An Ordinary Abstraction. From Abstraction to Bridge. Drivers as Bridges. Database Drivers. Summary.

II. RESPONSIBILITY PATTERNS.

7. Introducing Responsibility.

Ordinary Responsibility. Controlling Responsibility with Accessibility. Summary. Beyond Ordinary Responsibility.

8. Singleton.

Singleton Mechanics. Singletons and Threads. Recognizing Singleton. Summary.

9. Observer.

C# Support for Observer. Delegate Mechanics. A Classic Example-Observer in GUIs. Model/View/Controller. Layering. Summary.

10. Mediator.

A Classic Example-GUI Mediators. Relational Integrity Mediators. Summary.

11. Proxy.

A Simple Proxy. A Data Proxy. Remote Proxies. Summary.

12. Chain of Responsibility.

An Ordinary Chain of Responsibility. Refactoring to Chain of Responsibility. Anchoring a Chain. Chain of Responsibility without Composite. Summary.

13. Flyweight.

Immutability. Extracting the Immutable Part of a Flyweight. Sharing Flyweights. Summary.

III. CONSTRUCTION PATTERNS.

14. Introducing Construction.

A Few Construction Challenges. Summary. Beyond Ordinary Construction.

15. Builder.

An Ordinary Builder. Building under Constraints. A Forgiving Builder. Summary.

16. Factory Method.

A Classic Example-Enumerators. Recognizing Factory Method. Taking Control of Which Class to Instantiate. Factory Method in Parallel Hierarchies. Summary.

17. Abstract Factory.

A Classic Example-GUI Kits. Abstract Factories and Factory Method. Namespaces and Abstract Factories. Summary.

18. Prototype.

Prototypes as Factories. Prototyping with Clones. Summary.

19. Memento.

A Classic Example-Using Memento for Undo. Memento Durability. Persisting Mementos across Sessions. Summary.

IV. OPERATION PATTERNS.

20. Introducing Operations.

Operations and Methods. Signatures. Delegates. Exceptions. Algorithms and Polymorphism. Summary. Beyond Ordinary Operations.

21. Template Method.

A Classic Example-Sorting. Completing an Algorithm. Template Method Hooks. Refactoring to Template Method. Summary.

22. State.

Modeling States. Refactoring to State. Making States Constant. Summary.

23. Strategy.

Modeling Strategies. Refactoring to Strategy. Comparing Strategy and State. Comparing Strategy and Template Method. Summary.

24. Command.

A Classic Example-Menu Commands. Using Command to Supply a Service. Command Hooks. Command in Relation to Other Patterns. Summary.

25. Interpreter.

An Interpreter Example. Interpreters, Languages, and Parsers. Summary.

V. EXTENSION PATTERNS.

26. Introducing Extensions.

Principles of OO Design. The Liskov Substitution Principle. The Law of Demeter. Removing Code Smells. Beyond Ordinary Extensions. Summary.

27. Decorator.

A Classic Example-Streams. Function Wrappers. Decorator in GUIs. Decorator in Relation to Other Patterns. Summary.

28. Iterator.

Ordinary Iteration. Thread-Safe Iteration. Iterating over a Composite. Summary.

29. Visitor.

Visitor Mechanics. An Ordinary Visitor. Visitor Cycles. Visitor Controversy. Summary.

Appendix A: Directions.

Get the Most Out of This Book. Understand the Classics. Weave Patterns into Your Code. Keep Learning.

Appendix B: Solutions.
Appendix C: Oozinoz Source.

Acquiring and Using the Source. Building the Oozinoz Code. Helping the Oozinoz Code Find Files. Testing the Code with NUnit. Finding Files Yourself. Summary.

Appendix D: UML at a Glance.

Classes. Class Relationships. Interfaces. Delegates and Events. Objects. States.

Glossary.
Bibliography.
Index

商品描述(中文翻譯)

對於在 Microsoft 環境中學習的學生來說,本書是針對 C# 的原始設計模式文本的伴侶。本書是一部應用書,而非理論書。它是為那些希望更好地理解 Gamma 等人所著的經典設計模式書中所描述的模式的學生而寫的。本書的目的是讓學生有信心和能力應用 Gamma 書中識別的 23 種原始模式,所有的程式碼範例均以 C# 提供。

目錄:
前言。

1. 介紹。
為什麼要使用模式?為什麼要使用設計模式?為什麼選擇 C#?UML。挑戰。本書的組織。歡迎來到 Oozinoz!摘要。

I. 介面模式。
2. 介面的介紹。
介面與抽象類別。介面與委派。介面與屬性。介面細節。摘要。超越普通介面。

3. 適配器。
適配介面。類別和物件適配器。在 .NET 中適配數據。摘要。

4. 外觀。
普通外觀。重構為外觀。外觀、工具和示範。摘要。

5. 組合。
普通組合。組合中的遞歸行為。組合、樹和循環。具有循環的組合。循環的後果。摘要。

6. 橋接。
普通抽象。從抽象到橋接。驅動程式作為橋接。數據庫驅動程式。摘要。

II. 責任模式。
7. 責任的介紹。
普通責任。通過可訪問性控制責任。摘要。超越普通責任。

8. 單例。
單例機制。單例與執行緒。識別單例。摘要。

9. 觀察者。
C# 對觀察者的支持。委派機制。一個經典範例 - GUI 中的觀察者。模型/視圖/控制器。分層。摘要。

10. 中介者。
一個經典範例 - GUI 中介者。關聯完整性中介者。摘要。

11. 代理。
一個簡單的代理。一個數據代理。遠程代理。摘要。

12. 責任鏈。
普通責任鏈。重構為責任鏈。固定責任鏈。沒有組合的責任鏈。摘要。

13. 享元。
不可變性。提取享元的不可變部分。共享享元。摘要。

III. 建構模式。
14. 建構的介紹。
一些建構挑戰。摘要。超越普通建構。

15. 建造者。
普通建造者。在約束下建造。一個寬容的建造者。摘要。

16. 工廠方法。
一個經典範例 - 列舉。識別工廠方法。控制要實例化的類別。平行層次中的工廠方法。摘要。

17. 抽象工廠。
一個經典範例 - GUI 套件。抽象工廠與工廠方法。命名空間與抽象工廠。摘要。

18. 原型。
原型作為工廠。使用克隆進行原型設計。摘要。

19. 備忘錄。
一個經典範例 - 使用備忘錄進行撤銷。備忘錄的持久性。在會話之間持久化備忘錄。摘要。

IV. 操作模式。
20. 操作的介紹。
操作與方法。簽名。委派。例外。算法與多型。摘要。超越普通操作。

21. 模板方法。
一個經典範例 - 排序。完成一個算法。模板方法鉤子。重構為模板方法。摘要。

22. 狀態。
建模狀態。重構為狀態。使狀態常量。摘要。

23. 策略。
建模策略。重構為策略。比較策略與狀態。比較策略與模板方法。摘要。

24. 命令。
一個經典範例 - 菜單命令。使用命令提供服務。命令鉤子。命令與其他模式的關係。摘要。

25. 解釋器。
一個解釋器範例。解釋器、語言和解析器。摘要。

V. 擴展模式。
26. 擴展的介紹。
面向對象設計的原則。里氏替換原則。德米特法則。消除代碼異味。超越普通擴展。摘要。

27. 裝飾者。
一個經典範例 - 流。函數包裝器。GUI 中的裝飾者。裝飾者與其他模式的關係。摘要。

28. 迭代器。
普通迭代。線程安全的迭代。對組合進行迭代。摘要。

29. 訪問者。
訪問者機制。普通訪問者。訪問者循環。訪問者爭議。摘要。

附錄 A:指導。
充分利用本書。理解經典。將模式編織到你的代碼中。持續學習。

附錄 B:解決方案。
附錄 C:Oozinoz 源碼。
獲取和使用源碼。構建 Oozinoz 代碼。幫助 Oozinoz 代碼查找文件。使用 NUnit 測試代碼。自己查找文件。摘要。

附錄 D:UML 一覽。
類別。類別關係。介面。委派和事件。物件。狀態。

詞彙表。
參考文獻。
索引。

最後瀏覽商品 (20)