Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Linda: Top 10 patterns?

 
Trailboss
Posts: 23418
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I bet Factory and Abstract Factory will be in the Top 10 too.
-Mirko

[This message has been edited by Mirko Froehlich (edited January 31, 2001).]
 
Ranch Hand
Posts: 147
Python Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about Mediator, Command, and Delegate?
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about Composite, Proxy and Iterator, we used them long before the name of Design Pattern came into play.
 
Author
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd like to add the Acceptor/Connector pattern to this list. I think that it's very useful for client/server application in the telecom industry.
 
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is Acceptor/Connector something that Doug Schmidt came up with in connection with ACE or am I thinking of something else?
John
 
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Top 10 patterns in my experience are:
Abstract Factory, Factory Method
Observer
Mediator
Singleton
Facade
Iterator
Template
State
Composite
Adapter
My .02
HTH
Sanjay

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dont forget Strategy and Decorator!
Decorator is heavily used in AWT and Swing. ScrollPane and JScrollPane are Decorators. The high-level Stream classes are also Decorators.
The LayoutManagers are Strategies.
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want an obscure one, I really like Transfer Vector which comes from the Shlaer-Mellor methodology way back when. This states to define your subsystems/components (they called these domains) in your system and derive a generic type that can be used for communication between the subsystems. The "wormhole" is the particular entry/exit point from the domain and the bridge is the transfer method. This was all conceived before GoF - it is interesting to examine.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jim, it would be interesting if you would expand on Transfer Vector.
 
Darpesh Patel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jim, it would be interesting if you would expand on Transfer Vector.
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. TYPED MESSAGE may not be official yet but it's primary example is taken directly from the Java Event Handling model.
2. ITERATOR is directly supported by the Java2 API. (Look at Iterator Interface and ArrayLists)
3. DECORATOR is used in Swing. (Look at JScrollPane and any component that scrollable)
4. OBSERVER is used directly by the Java2 API. (Look at, Observer, Observable)
5. ADAPTER is an obvious one if you've use Anonymous inner classes, (see WindowAdapter)
And much more, Im sure. Out of the orginal 23 GoF patterns, I'm guessing most of them or some variation is not only used in Java2 by developers but even directly implemented like the ones above.
------------------
David Roberts, SCJP2
[This message has been edited by David Roberts (edited March 14, 2001).]
[This message has been edited by David Roberts (edited March 14, 2001).]
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic