圖書,(美)麥斯科編著。StevenJohnMetsker解釋了用C#作為面向對象程式語言時,如何利用設計模式來創建簡潔的代碼,與此同時,還能有效地利用內容廣泛的Microsoft.NET框架類庫。針對所有23個經典的“四個小姐”(GangofFour)設計模式,Metsker提供了詳細的代碼實例,這些代碼實例使用了C#和。NET框架。
基本介紹
- 書名:C#設計模式(影印版)
- 作者:(美)麥斯科
- ISBN:9787508342955
- 定價:49.00 元
- 出版社:中國電力出版社
- 出版時間:2006
- 開本:16
內容簡介,作者簡介,目錄,
內容簡介
設計模式有助於開發人員利用整個軟體開發群體的智慧開發健壯的高質量軟體。本書是第一部完整的面向C#和.NET程式設計師的設計模式指導著作。
StevenJohnMetsker解釋了用C#作為面向對象程式語言時,如何利用設計模式來創建簡潔的代碼,與此同時,還能有效地利用內容廣泛的Microsoft、NET框架類庫。
針對所有23個經典的“四個小姐”(GangofFour)設計模式,Metsker提供了詳細的代碼實例,這些代碼實例使用了C#和.NET框架,同時提供了有助於快速掌握相關技巧的程式設計習題。這些習題廣泛地使用了UML標準表示法的基礎上學習掌握相關技能。
如果讀者已經基於其他程式設計語言使用了軟體設計模式,那么本書有助於加深讀者的理解,增加讀者的自信心,並能幫助讀者在各種類型的C#工程中使用設計模式。如果讀者是一位Microsoft程式設計師,但是還不熟悉設計模式,那么本書是一本理想的實踐入門指導。
作者簡介
STEVENJOHNMETSKER在設計模式、面向對象程式設計及軟體設計方法學等領域有廣泛的著述。Steven是CapTech風險投資公司的一位軟體業務諮詢人員,經常在OOPSLA會議上發言。他的著作發表在《JavaReport》、《JOOP》、《DistributedObjectComputing》、《ObjectMaazine》等雜誌上。Steven在Addison-Wesley公司出版的著作包括:《DesignPatternsJaveWorkbook》(影印版《設計模式Java手冊》已由中國電力出版社出版)和《BuildingParsersinJava》。
目錄
Preface
Chapter 1: Introduction
Why Patterns?
Why Design Patterns?
Why C#?
UML
Challenges
The Organization of this Book
Welcome to Oozinoz!
Summary
Part 1: Interface Patterns
Chapter 2: Introducing Interfaces
Interfaces and Abstract Classes
Interfaces and Delegates
Interfaces and Properties
Interface Details
Summary
Beyond Ordinary Interfaces
Chapter 3: Adapter
Adapting to an Interface
Class and Object Adapters
Adapting Data in .NET
Summary
Chapter 4: Facade
An Ordinary Facade
Refactoring to Facade
Facades, Utilities, and Demos
Summary
Chapter 5: Composite
An Ordinary Composite
Recursive Behavior in Composites
Composites, Trees, and Cycles
Composites with Cycles
Consequences of Cycles
Summary
Chapter 6: Bridge
An Ordinary Abstraction
From Abstraction to Bridge
Drivers as Bridges.
Database Drivers
Summary
Part 2: Responsibility Patterns
Chapter 7: Introducing Responsibility
Ordinary Responsibility
Controlling Responsibility with Accessibility
Summary
Beyond Ordinary Responsibility
Chapter 8: Singleton
Singleton Mechanics
Singletons and Threads
Recognizing Singleton
Summary
Chapter 9: Observer
C# Support for Observer
Delegate Mechanics
A Classic Example---Observer in GUIs
Model/View/Controller
Layering
Summary
Chapter 10: Mediator
A Classic Example---GUI Mediators
Relational Integrity Mediators
Summary
Chapter 11: Proxy
A Simple Proxy
A Data Proxy
Remote Proxies
Summary
Chapter 12: Chain of Responsibility
An Ordinary Chain of Responsibility
Refactoring to Chain of Responsibility
Anchoring a Chain
Chain of Responsibility without Composite
Summary
Chapter 13: Flyweight
Immutability
Extracting the Immutable Part of a Flyweight
Sharing Flyweights
Summary
Part 3: Construction :Patterns
Chapter 14: Introducing Construction
A Few Construction Challenges
Summary
Beyond Ordinary Construction
Chapter 15: Builder
An Ordinary Builder
Building under Constraints
A Forgiving Builder
Summary
Chapter 16: Factory Method
A Classic Example Enumerators
Recognizing Factory Method
Taking Control of Which Class to Instantiate
Factory Method in Parallel Hierarchies
Summary
Chapter 17: Abstract Factory
A Classic Example GUI Kits
Abstract Factories and Factory Method
Namespaces and Abstract Factories
Summary
Chapter 18: Prototype
Prototypes as Factories
Prototyping with Clones
Summary
Chapter 19: Memento
A Classic Example Using Memento for Undo
Memento Durability
Persisting Mementos across Sessions
Summary
Part 4: Operation Patterns
Chapter 20: Introducing Operations
Operations and Methods
Signatures
Delegates
Exceptions
Algorithms and Polymorphism
Summary
Beyond Ordinary Operations
Chapter 21: Template Method
A Classic Example--Sorting
Completing an Algorithm
Template Method Hooks
Refactoring to Template Method
Summary
Chapter 22: State
Modeling States
Refactoring to State
Making States Constant
Summary
Chapter 23: Strategy
Modeling Strategies
Refactoring to Strategy
Comparing Strategy and State
Comparing Strategy and Template Method
Summary
Chapter 24: Command
A Classic Example--Menu Commands
Using Command to Supply a Service
Command Hooks
Command in Relation to Other Patterns
Summary
Chapter 25: Interpreter
An Interpreter Example
Interpreters, Languages, and Parsers
Summary
Part 5: Extension Patterns
Chapter 26: Introducing Extensions
Principles of OO Design
The Liskov Substitution Principle
The Law of Demeter
Removing Code Smells
Beyond Ordinary Extensions
Summary
Chapter 27: Decorator
A Classic Example--Streams
Function Wrappers
Decorator in GUIs
Decorator in Relation to Other Patterns
Summary
Chapter 28: Iterator
Ordinary Iteration
Thread-Safe Iteration
Iterating over a Composite
Summary
Chapter 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