If you want to speed up the development of your .NET applications, you're ready for C# design patterns -- elegant, accepted and proven ways to tackle common programming problems. This practical guide offers you a clear introduction to the classic object-oriented design patterns, and explains how to use the latest features of C# 3.0 to code them.
C# Design Patterns draws on new C# 3.0 language and .NET 3.5 framework features to implement the 23 foundational patterns known to working developers. You get plenty of case studies that reveal how each pattern is used in practice, and an insightful comparison of patterns and where they would be best used or combined. This well-organized and illustrated book includes:
An explanation of design patterns and why they're used, with tables and guidelines to help you choose one pattern over another
Illustrated coverage of each classic Creational, Structural, and Behavioral design pattern, including its representation in UML and the roles of its various players
C# 3.0 features introduced by example and summarized in sidebars for easy reference
Examples of each pattern at work in a real .NET 3.5 program available for download from O'Reilly and the author's companion web site
Quizzes and exercises to test your understanding of the material.
With C# 3.0 Design Patterns, you learn to make code correct, extensible and efficient to save time up front and eliminate problems later. If your business relies on efficient application development and quality code, you need C# Design Patterns.
Chapter 1 C# Meets Design Patterns
About C# 3.0
About the Examples
Chapter 2 Structural Patterns: Decorator, Proxy, and Bridge
Chapter 3 Structural Patterns: Composite and Flyweight
Example: Photo Library
Chapter 4 Structural Patterns: Adapter and Façade
Chapter 5 Creational Patterns: Prototype, Factory Method, and Singleton
Factory Method Pattern
Chapter 6 Creational Patterns: Abstract Factory and Builder
Abstract Factory Pattern
Chapter 7 Behavioral Patterns: Strategy, State, and Template Method
Template Method Pattern
Chapter 8 Behavioral Patterns: Chain of Responsibility and Command
Chain of Responsibility Pattern
Chapter 9 Behavioral Patterns: Iterator, Mediator, and Observer
Pattern Discussion and Comparison
Chapter 10 Behavioral Patterns: Visitor, Interpreter, and Memento
Judith Bishop is a computer scientist, in Pretoria South Africa, specializing in the application of programming languages to distributed systems and web-based technologies. She is internationally known as an advocate of new technology. Her books on Java and C# have been published in six languages. She represents South Africa on IFIP TC2 on software and is a chair or member of numerous international conference committees and editorial boards.
The animal on the cover of C# 3.0 Design Patterns is a greylag goose (Anser anser), probably one of the first domesticated animals. Archaeological evidence suggests that domestic geese lived in ancient Egypt and Rome 3,000 years ago.Fairly large birds, usually weighing between 5 12 pounds, greylag geese have an average wingspan of 59 66 inches and are generally 29 30 inches in length. Their plumage is grayish-brown, their bellies are white, and their lower breasts are shaded gray. Their bills are large and yellow, and their feet and legs are a pink, flesh-like color. (Younger geese have gray legs and feet that turn pinker as they age.)They are migratory birds that fly south or west in the winter to escape the harsh weather. During the summer, they live in Scotland, Iceland, Scandinavia, as far east as Russia, Poland, and Germany. In autumn, the geese in Iceland migrate to the British Isles, while the rest of the greylag geese in Europe head to places like the Netherlands, Spain, France, and East Africa.A social bird, it travels long distances in groups, often in the familiar v-shape pattern. Their groups range from small families to flocks with tens of thousands of geese.The time at which their breeding season begins depends on their geographic location. In Scotland, breeding starts in late April; in Iceland it starts in early May; and in Europe, it starts earlier. During breeding season, greylag geese live in marshes and fens-places with a lot of vegetation. Nests are built in high places to keep their eggs safe from predators.A mother can lay as many as 12 eggs, but she usually lays between 4 and 6. She incubates the eggs for approximately 26 days. Once hatched, the goslings wait until they are dry to leave the nest. Young birds feed themselves with their parents' supervision. Twenty years is their average life expectancy.Greylag geese thrive on grasses, roots, rhizomes of marsh plants, and small aquatic animals. They also have a taste for some root crops-turnips, potatoes, and carrots-a real concern for farmers in Europe.Golden eagles, ravens, and hawks are among their predators in the sky; when on the ground, they have to be vigilant for prowling dogs, foxes, and humans. Humans hunt geese for their flavorful meat and their down, or soft feathers. Down is often used to stuff pillows, blankets, and outdoor clothing.Caesar, the Roman emperor, declared greylag geese as sacred in 390 B.C., and he made it illegal to kill and consume them. Caesar credited them with saving his empire from attack. He believed that when the Gauls tried to invade, the geeses' loud calls alerted the Romans and saved them from occupation.The cover image is from Dover Animals Book. The cover font is Adobe ITC Garamond. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed.
I really don't like this book. Twice I've tried reading it to learn the design patterns presented, and both times I end up getting frustrated at the amount of typos in the code examples. And I always end up looking through the errata section and see that the typos have been reported but still "unconfirmed". Additionally I feel some of the examples are poor, and don't always clearly illustrate the point. Not the usual level of quality I'm used to in Oreilly books. To the author: please edit this book properly.
Bottom Line No, I would not recommend this to a friend
I tired to read other design pattern books before with not much success. this book explains patterns and gives coulple of easy to understand examples. it also tries to use some C#/.Net feature like delegates which i found useful.
Bottom Line Yes, I would recommend this to a friend
In my noble opinion Judith Bishop really earns a statue! So many patterns so well explained for the C# .Net developer in so few pages including examples. Congratulations!
I really used some -many codelines saving- stuff from the book. Although I still haven't the time yet to read the book cover to cover, I already used several patterns from the book in 'real programming live'. I already used it several times as a reference guide and it really guides me well (some of my coworker coming over to see what wonderful code I have made).
Also wonderful that it's dealing up to version 3.0 of C#.
Judith has finally done the fantastic job for .NET developer communities with respect to implementation of classic Design Patterns of GOF. There are plenty good books in the market for Design Pattern for .NET implementation. However, they are mostly of syntactical polymorphisms without leveraging the actual technologies or platform such as .NET or C#. They are either inherently or smartly transcended implementation of Java or C++ lingo though it shows as C# implementation.
I like particularly the way Judith twisted on lazy singleton pattern with nested class for instance. That's a good example of leveraging on the true .NET or C# power. That's not all, if you look each one of the implementations for each design pattern specific, this is the way you need to go and do implementation in C# or .NET technologies.
Congratulation Judith! You have done a very good job for .NET designers and developers. It will change lots of code designs and implementations in next few years to intermediate developers mindsets.
Essential design patterns book for .NET developers
By Alan Sheats
Comments about oreilly C# 3.0 Design Patterns:
C# 3.0 Design Patterns by Judith Bishop takes a new approach to a classic subject. In so doing, Bishop imparts deep insight into what is widely considered a difficult subject and conveys practical knowledge in a concise manner that will greatly benefit any serious developer programming in C# for .NET.
After an introductory chapter entitled "C# Meets Design Patterns," there are nine chapters presenting all of the 23 classic design patterns from Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides's seminal work Design Patterns: Elements of Reusable Object-Oriented Software. The patterns are presented two or three at a time, and each chapter begins with a real-world illustration of the pattern in action. This is followed by a clear UML diagram, a concise description of the pattern players and their roles and a theory example that implements the pattern in quesiton in a complete console application that is made as short as possible, usually 50 to 80 lines of code.
After presenting each pattern, Bishop provides one or more examples, several of which are carried over to and expanded in subsequent chapters, and presents numerous exercises for the reader. Each chapter typically contains sidebars briefly describing one or more C# features and how they can be leveraged in implementing the pattern at hand. There is also excellent guidance on when to use each pattern and an invaluable comparison of the patterns presented in each chapter that provides further insight into their characteristics. In addition, all of the patterns, their interactions and the examples in which they are illustrated are summarized in the final chapter.
In a book of less than 300 pages, the examples, although highly relevant to practical programming problems, are necessarily somewhat simplistic. They do not contain any of the error checking, exception handling or test methods that would be present in industrial-strength code. Nonetheless, they are all complete programs that clearly illustrate the pattern in question and how to code it in C#. Several of the examples are also expanded over several chapters and presented in an appendix as fully functional programs that can be easily extended to provide additional functionality.
Perhaps the greatest strength of Bishop's book and its greatest benefit to C#/.NET developers is its description of advanced C# 3.0 features and how they can be leveraged to create pattern implementations that are elegant and concise. Bishop not only writes with the authority one would expect of a professor of computer science. It is also very evident that she is an educator who has considerable experience in making difficult subjects comprehensible. As Microsoft C# Senior Developer Eric Lippert puts it in his preface to the book, "C# 3.0 Design Patterns brings the frequently abstruse world of design patterns into sharp focus with pragmatic C# 3.0 implementations."
Accomplishing this in less than 300 pages is nothing short of a tour de force. I have been trying for some time to get my head around design patterns and searching for good C# implementations. Now my search is over, and I have a practical guide to understanding and implementing the patterns that I need written by an accomplished theorist, practitioner and educator.