Design Patterns in C#
Steven John Metsker

ISBN-10: 0321126971
ISBN-13: 9780321126979

Publisher: Addison-Wesley Professional
Copyright: 2004
Format: Cloth; 480 pp
Published: 04/15/2004

Suggested retail price: $59.99
Buy from myPearsonStore

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#.

For developers in the Microsoft environment, a companion to the original Design Patterns text tailored to the C# programming language.

° A catalog of proven solutions to recurring problems in C# software design

° Part of the Addison-Wesley Software Patterns Series, with John Vlissides as consulting editor

° Allows the growing legions of Microsoft technology developers to apply traditional software approaches to frequently encountered problems



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.

STEVEN JOHN METSKER has written extensively on design patterns, object-oriented programming, and software methodologies. Steve is a software consultant with CapTech Ventures, and a frequent speaker at OOPSLA conferences. His work has appeared in journals including Java Report, JOOP, Distributed Object Computing, and Object Magazine. Steve's Addison Wesley books include Design Patterns Java Workbook and Building Parsers in Java.

Steven John Metsker explains how to use C# as an object-oriented language, using design patterns to create clean code while taking advantage of the extensive Microsoft(R) .NET Framework Class Libraries.

For all 23 classic "Gang of Four" design patterns, Metsker offers detailed code examples utilizing C# and the .NET Framework--as well as programming exercises crafted to help you rapidly build expertise. His exercises and explanations make extensive use of the Unified Modeling Language, helping you build your skills in this standard notation.

Design patterns covered include:

  • Interfaces: Adapter, Facade, Composite, and Bridge
  • Responsibility: Singleton, Observer, Mediator, Proxy, Chain of Responsibility, and Flyweight
  • Construction: Builder, Factory Method, Abstract Factory, Prototype, and Memento
  • Extensions: Decorator, Iterator, and Visitor

If you've already used design patterns in other languages, Design Patterns in C# will deepen your understanding, build your confidence, and help you apply them to any C# project. If you're a Microsoft programmer who's new to design patterns, this book will be an ideal practical introduction.

www.awprofessional.com/patterns/

ADDISON-WESLEY PROFESSIONAL

Pearson Education

ISBN: 0-321-12697-1

View a Sample Chapter PDF: /samplechapter/0321126971.pdf

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students, contact your Pearson Higher Education representative for pricing and ordering information.

This title is a member of the Software Patterns Series, which also contains the titles below . You can also visit the Software Patterns Series page.

  • 0321247140Design Patterns Explained: A New Perspective on Object-Oriented Design, 2/E
    Shalloway & Trott
    © 2005 | Addison-Wesley Professional | Paper; 480 pages | Instock
    ISBN-10: 0321247140 | ISBN-13: 9780321247148
    Brief Description | Buy from myPearsonStore

  • 0201743973Design Patterns Java™ Workbook
    Metsker
    © 2002 | Addison-Wesley Professional | Paper; 496 pages | Instock
    ISBN-10: 0201743973 | ISBN-13: 9780201743975
    Brief Description | Buy from myPearsonStore

  • 0201184621The Design Patterns Smalltalk Companion
    Alpert, Brown & Woolf
    © 1998 | Addison-Wesley Professional | Paper; 464 pages | Instock
    ISBN-10: 0201184621 | ISBN-13: 9780201184624
    Brief Description | Buy from myPearsonStore

  • 0321126971Design Patterns in C#
    Metsker
    © 2004 | Addison-Wesley Professional | Cloth; 480 pages | Instock
    ISBN-10: 0321126971 | ISBN-13: 9780321126979
    Brief Description | Buy from myPearsonStore

  • 0321333020Design Patterns in Java™, 2/E
    Metsker & Wake
    © 2006 | Addison-Wesley Professional | Cloth; 480 pages | Instock
    ISBN-10: 0321333020 | ISBN-13: 9780321333025
    Buy from myPearsonStore

  • 0201432935Pattern Hatching: Design Patterns Applied
    Vlissides
    © 1998 | Addison-Wesley Professional | Paper; 192 pages | Instock
    ISBN-10: 0201432935 | ISBN-13: 9780201432930
    Brief Description | Buy from myPearsonStore

  • 0321228111Patterns for Parallel Programming
    Mattson, Sanders & Massingill
    © 2005 | Addison-Wesley Professional | Cloth; 384 pages | Instock
    ISBN-10: 0321228111 | ISBN-13: 9780321228116
    Buy from myPearsonStore

  • 0201741172Software Configuration Management Patterns: Effective Teamwork, Practical Integration
    Berczuk & Appleton
    © 2003 | Addison-Wesley Professional | Paper; 256 pages | Instock
    ISBN-10: 0201741172 | ISBN-13: 9780201741179
    Buy from myPearsonStore

Pearson Higher Education offers special pricing when you choose to package your text with other student resources. If you're interested in creating a cost-saving package for your students contact your Pearson Higher Education representative.


Copyright ©2008 Pearson Education. All rights reserved. Legal Notice | Privacy Policy | Permissions