Originally posted by Paul Wheaton:
Linda,
Since you are clearly familiar with so many patterns, what, in your opinion, are the 10 most frequently used patterns in Java?
I suspect Singleton, Facade and Observer would make the list. But I'm guessing that there will probably be a few that I don't know on the list.
Hi Paul,
One of the parts of the Alamanac that I am most happy about is the list of experience papers that follow each pattern. These are published reports of actual use of the pattern. I'm not sure how many of these papers were written by Java users but using the number of papers as an indicator of over-all use it's easy to see that the patterns in the GoF book lead the others. I don't think this is because they are better than the others -- only more well known. Here's the list of GoF patterns in order of use with the most used listed first and equal numbers of uses on the same line:
Adapter
Composite, Strategy
Observer, State
Command, Mediator, Singleton
Abstract Factory, Factory Method, Facade
Template Method, Visitor
Builder, Prototype, Bridge, Proxy
Decorator, Memento
Iterator
Flyweight, Interpeter had no experience reports
I think we need more experienced users to tell about their experience. We all learn more when he hear how someone used a pattern to solve a real problem *and* when a detailed example in a particular domain is given.
Thanks for an interesting question!
Linda
------------------
Linda Rising
Author of
The Pattern Almanac 2000