REVIEW - Design Patterns in C#

Title:

Design Patterns in C#

Author:

Steven John Metsker

ISBN:

0321126971

Publisher:

Addison-Wesley Professional (2004)

Pages:

456pp

Reviewer:

Paul Grenyer

Reviewed:

October 2004

Rating:

2 out of 5

The index of the book lists all 23 of the original GoF design patterns. A number of them are described in great depth and some even delve into examples of their use in the .Net framework and a description of what might be found when searching for the pattern name in MSDN. Some patterns also have examples of different methods of implementation. For example, the Adapter pattern describes a solution involving sub-classing and another using composition.

The description of Facade is particularly good and has a well thought out example that most people, and especially people who have written database clients, can relate too.

Some patterns such as Composite and Flyweight get the idea behind the pattern across but fail to provide a real world example. Singleton has quite a brief description and covers issues that arise from using singletons in threaded environments. However, there is no mention of the controversy over the use of Singleton, as there is for Visitor.

The author has left a number of diagrams and code fragments incomplete as exercises for the reader, with the complete diagrams and code in the Solutions appendix. I found this incredibly irritating and frustrating as I was trying to relate the text to the supplied figure. It also makes this book more difficult to use as a reference. Protected data is used throughout the examples even in classes that would most likely remain the most derived (leaf) class.

There were a lot of things I did not like about this book, but most of that was style and a bit of bad practice in the code. However, there was a lot more I liked about it. Comparing with GoF, for the most part, the patterns are explained more clearly in this book and in greater depth and with better examples. If it is the patterns that you are interested in learning about then I rate this book over GoF. I think you should still read Design Patterns Explained by Alan Shalloway and James J. Trott first.


Book cover image courtesy of Open Library.