开发者

Examples of Design Patterns used in JDK [duplicate]

This question already has answers here: Closed 12 years ago.

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 开发者_JS百科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?


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

For a complete answer, read this: Examples of GoF Design Patterns in Java's core libraries


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


Resources :

  • Java BluePrints


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

  • Factory
  • Observer & Observable
  • Visitor
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜