At the time I was writing the first draft of this book, I also
happened to be learning about design patterns. Gradually, it became
obvious that much of the AWT was written by programmers who had
patterns on the brain. The
is a textbook example of the “abstract factory” pattern.
openConnection() method is a factory method. The
Writer classes are
decorators on top of
OutputStream. The engine classes in the JCE are
proxies, and I could cite many more examples. Much of the class
package—has been designed with design patterns, and it will all
make a lot more sense if you’re familiar with the standard
The seminal text on the subject is Design Patterns, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Addison-Wesley, 1995). The four authors are colloquially known as the “Gang of Four,” and the book is often cited informally as “GoF.” The 23 patterns covered in GoF are rapidly becoming part of the vocabulary of the object-oriented programming community. Design patterns are also beginning to be covered in many more introductory books about object-oriented programming and Java.
There are also several extremely active mailing lists and web sites devoted to design patterns. To subscribe to the email@example.com list send email to firstname.lastname@example.org with the word “subscribe” in the Subject: field. Archives of this and several related lists may be ...