by Alan Shalloway, James R. Trott
Addison-Wesley Pub Co

Design Patterns Explained is a book that was recommended to me
by a friend. He told me he really liked it so I decided to give
it a try. I had always been hesitant to really investigate Design
Patterns after hearing some of the stories people had told me about
different books they had read. It didn’t sound like much
fun. Luckily, I decided to give this book a try. It was a great
experience. Read on to find out why!
Summary:
Chapter 1: The Object-Oriented Paradigm
The first chapter introduces us to Functional Decomposition, handling
changing requirements, and the OO Paradigm. Functional Decomposition
is the process by which many developers would break down a problem
and create a solution. The Authors state this is a fairly natural
process that many folks use. The problem is that this process
does not really look at other alternatives, which may be available.
It also makes it harder for the developer to handle changing
requirements. The Authors finish the chapter by discussing the
OO Paradigm and concepts of OO Programming. This chapter is well
written, and you come out of it ready for the rest of the book.
Chapter 2: The UML - The Unified Modeling Language
This chapter gives an overview of UML. Even though it is a quick
chapter, the authors do a fantastic job explaining UML and how
to read the diagrams.
Chapter 3: A Problem that Cries Out for Flexible Code
Chapter 4: A Standard Object-Oriented Solution
In chapter 3 the author illustrates a problem that needs to be
solved, actually using an example from his real world experiences
(CAD/CAM Application). He shows us the process by which we can
get a better understanding of the problem, and then how to describe
and define what the problems are. In chapter 4 a solution is given
and discussed. It is shown why this is a good first solution, but
why it is not a good final solution. Code examples are given in
Java and C++, but don’t worry if you are not real familiar
with those languages. The theory is written in such a way that
it is easy to understand, and the UML lesson in chapter 2 will
be a great help.
Chapter 5: An Introduction to Design Patterns
This chapter is, as the title would indicate, an intro to Design
Patterns. The origins of Design Patterns are discussed, and we
find out how it was taken from the Architecture world and brought
into the software realm. It is a very well written and understandable
chapter that sets the reader up for the next 5 chapters.
Chapter 6: The Facade Pattern
This chapter discusses the Facade Pattern, which is a pattern that
most have probably used but not realized it. This pattern is
used when you have a very complex system and only need to use
a subset or part of it. This is a small, but well written chapter
Chapter 7: The Adapter Pattern
The Adapter pattern is creating a new interface for an object whose
interface just isn’t doing the job. A great example is
shown, and you leave the chapter understanding what the Adapter
Pattern is and what it should be used for.
Chapter 8: Expanding Our Horizons
In this chapter the authors talk about Object, Encapsulation, and
Inheritance but not just in the ways you might think. They introduce
different ways of thinking about them than the usual, and expand
our understanding of what is possible.
Chapter 9: The Bridge Pattern
This chapter discusses the Bridge Pattern in great detail. The
authors state that this is a very difficult pattern to understand
because it is extremely powerful. The two main ideas are “find
what varies and encapsulate it” and “favor composition
over inheritance”. This chapter will teach you what this
actually means and how to use it.
Chapter 10: The Abstract Factory Pattern
This chapter starts out with an example that will that will lead
to knowing what the Abstract Factory Pattern is, and then shows
you how to implement it. The authors do a great job illustrating
their ideas.
Chapter 11: How Do Experts Design?
In this chapter the discussion returns to the roots of Design Patterns,
and discusses Christopher Alexander’s approach to Architecture
design. From this the authors can extend Alexander’s theories
and practices into the software world.
Chapter 12: Solving the CAD/CAM Problem with Patterns
This chapter returns to the original CAD/CAM example. Armed with
the knowledge of patterns we have learned, the discussion goes
in depth to show how we can use patterns to solve the same problem
more efficiently and with room to grow in the future.
Chapter 13: The Principles and Strategies of Design Patterns
This is a very brief chapter that covers designing from context,
and encapsulating variations in classes. I am not sure why this
chapter needed to be here, and not added in to a different one.
But, it is well written and gives good insights into these two
design strategies.
Chapter 14: The Strategy Pattern
Chapter 15: The Decorator Pattern
Chapter 16: The Singleton Pattern and the Double-Checked Locking
Pattern
Chapter 17: The Observer Pattern
Chapter 18: The Template Method Pattern
Chapter 19: The Factory Method Pattern
In chapters 14-19 a new case study is introduced. It involves e-tailing
which is defined as electronic retailing over the Internet. I am
not going into specifics on each chapter because they would basically
each describe the new pattern, and how it can be applied in the
case study. Each chapter builds on the ideas of the one before
it, and gives great insight into the when and why of using each
of the patterns discussed. These chapters flow very well into one
another. The authors provide us with not only clearly written ideas,
but also excellent illustrations and charts that drive their ideas
home.
Chapter 20: The Analysis Matrix
This chapter concludes the e-tailing case study in chapters 14-19
by discussing variations that occur in the problem domain. The
authors state, “In the real world, problems are not tidy
or well behaved”. My personal experiences have taught me
to believe the same thing. The numbers of exceptions and / or
variations that pop up seem to be infinite. Through use of the
Analysis Matrix, we can reveal patterns that manifest in the
problem, and can deal with them accordingly. The authors use
excellent examples of how to use the Analysis Matrix, and use
real world examples to reinforce the use of such a tool.
Chapter 21: Design Patterns Reviewed From Our New Perspective
of Object-Oriented Design
This short summation chapter takes us on a brief high-level review
of key points.
Chapter 22: Bibliography
The authors give a listing of books they feel would be good further
reading so you can continue your journey.
To conclude this review I would like to say a few things. One
is that I was very impressed by the way that this book was written.
It takes some pretty hard concepts and breaks them down into understandable
comparisons to real-world examples. Not only that, but the ideas
are very well organized, and written in such a way that just about
anyone could understand them. The entire book is this way, and
the authors are adept at it. That is not as easy as it may sound.
Many have tried, but few have succeeded. The authors excel in this,
and as a result create a finished product that is one of the most
well written technical books I have ever reviewed.
Another thing I liked
about the book was that the chapter end summaries were very short,
and outlined each chapter’s key
points perfectly. Also, the margins of the book have the key points
next to the main paragraphs for each. This is a great idea because
it makes looking back through the book for specific points much
easier. Since the key ideas are in the margin surrounded by white
space, they stick out and are easily noticeable while flipping
through pages. I wish more of my favorite books had this little
nifty feature.
If I could change one
thing about the book it would be to write it with VB examples
in addition to the Java and C++ ones it has.
Maybe by the next edition there will be some VB.net examples since
VB.net is now truly Object-Oriented. I would really like that.
Don’t be scared of the book just because it has only Java
and C++ examples though. They explanations of theory are so well
written that the example language would not be a barrier.
I give this book a 10 out of 10. It is an excellent book, and
one that is worth your while to read. |