300
Chapter 15 Design Patterns
Many people believe that antipatterns are actually more useful than design patterns.This
is because antipatterns are designed to solve problems that have already occurred.This
boils down to the concept of root-cause analysis.A study can be conducted with actual
data that might indicate why the original design, perhaps an actual design pattern, did not
succeed. It might be said that antipatterns emerge from the failure of previous solutions.
Thus, antipatterns have the benefit of hindsight.
For example, in his article “Reuse Patterns and Antipatterns,” Scott Ambler identifies a
pattern called a robust artifact, and defines it as follows:
An item that is well-documented, built to meet general needs instead of project-specific needs,
thoroughly tested, and has several examples to show how to work with it. Items with these qual-
ities are much more likely to be reused than items without them. A Robust Artifact is an item
that is easy to understand and work with.
However, there are certainly many situations when a solution is declared reusable and
then no one ever reuses it.Thus, to illustrate an antipattern, he writes:
Someone other than the original developer must review a Reuseless Artifact to determine
whether or not anyone might be interested in it. If so, the artifact must be reworked to become
a Robust Artifact.
Thus, antipatterns lead to the revision of existing designs, and the continuous refactoring
of those designs until a workable solution is found.
Conclusion
In this chapter, we explored the concept of design patterns. Patterns are part of everyday
life, and this is just the way you should be thinking about object-oriented designs.As with
many things pertaining to information technology, the roots for solutions are founded in
real-life situations.
Although this chapter covered design patterns only briefly, you should explore this topic
in greater detail by picking up one of the books referenced at the end of this chapter.
References
Alexander, Christopher, et al. A Pattern Language:Towns, Buildings, Construction. Oxford
University Press, 1977. Cambridge, United Kingdom.
Gamma, Erich, et al. Design Patterns: Elements of Reusable Object-Oriented Software.Addison-
Wesley, 1995. Boston, MA.
Larman, Craig. Applying UML and Patterns:An Introduction to Object-Oriented Analysis and
Design and Iterative Development, 3rd ed.Wiley, 2004. Hoboken, NJ.
Grand, Mark. Patterns in Java:A Catalog of Reusable Design Patterns Illustrated with UML,
2nd ed.,Volume 1.Wiley, 2002.
Ambler, Scott.“Reuse Patterns and Antipatterns.” 2000 Software Development Magazine.
Jaworski, Jamie. Java 2 Platform Unleashed. Sams Publishing, 1999. Indianapolis, IN.
Johnson, Johnny.“Creating Chaos.” American Programmer, July 1995.