views:

144

answers:

3

Possible Duplicate:
Examples of GoF Design Patterns

At an interview a while back I was asked for some examples of Design Patterns within the JDK.

Off the top of my head I was able to identify

Flyweight - as used in the String pool Singleton - in java.lang.Runtime Iterator - as used on Collections classes

Not that many.

What are the other good examples of Design Patterns as used in the JDK?

+2  A: 

Observer interfaces, you have them out-of-the-box.

For a complete answer, read this: http://stackoverflow.com/questions/1673841/examples-of-gof-design-patterns

pakore
+1  A: 

You can try a straightforward approach: goto the JDK Javadoc and search for (Ctrl + F) the names of some design patterns. For example,

Shakedown
+2  A: 

Ouch, that's a tough question. Patterns are used almost everywhere in java. You can find some patterns used in JEE on the Java BluePrints page.


Resources :

Colin Hebert