REVIEW - Design Patterns in C#


Design Patterns in C#


Steven John Metsker



Addison-Wesley Professional (2004)




Paul Grenyer


October 2004



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.

Your Privacy

By clicking "Accept All Cookies" you agree ACCU can store cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

By clicking "Share IP Address" you agree ACCU can forward your IP address to third-party sites to enhance the information presented on the site, and that these sites may store cookies on your device.