You can find an overview of a lot design patterns in Wikipedia. It also mentions which patterns are mentioned by GoF. I'll sum them up here and try to assign as much as possible pattern implementations found in both the Java SE and Java EE API's.
Abstract factory (recognizeable by creational methods returning an abstract/interface type)
Builder (recognizeable by creational methods returning the instance itself)
Factory method (recognizeable by creational methods returning a concrete type)
Prototype (recognizeable by creational methods returning a different instance of itself with the same properties)
Singleton (recognizeable by creational methods returning the same instance (usually of itself) everytime)
Adapter (recognizeable by creational methods taking an instance of different abstract/interface type and returning an implementation of own/another abstract/interface type which decorates/overrides the given instance)
Bridge (recognizeable by creational methods taking an instance of different abstract/interface type and returning an implementation of own abstract/interface type which delegates/uses the given instance)
- None comes to mind yet. A fictive example would be
new LinkedHashMap(LinkedHashSet<K>, List<V>)
which returns an unmodifiable linked map which doesn't clone the items, but uses them. The java.util.Collections#newSetFromMap()
and singletonXXX()
methods however comes close.
Composite (recognizeable by behavioral methods taking an instance of same abstract/interface type)
Decorator (recognizeable by creational methods taking an instance of same abstract/interface type)
Facade (recognizeable by behavioral methods which internally uses instances of different independent abstract/interface types)
相关推荐
JAVA设计模式在JDK中的应用JAVA设计模式在JDK中的应用 各种设计模式在JDK当中使用的地方 方便分析源码
jdk中设计模式 归纳了JDK中所包含的设计模式,包括作用和其设计类图
该文档整理了JDK中有关的设计模式,包括创建型、结构型、行为型等模式在JDK中的应用
设计模式在JDK中的应用课设--PPT资源 题目要求: 设计模式在JDK中的应用(结合JDK源码,分析JDK对设计模式的支持与应用)。课设内容包括: (a)用UML类图分析JDK所支持或应用的设计模式的结构,并与GOF的结构加以...
介绍java二十三种设计模式,包括模式的描述,适用性,模式的组成部分,并附带有简单的例子和类图,目的是为了让读者了解二十三种设计模式,并能方便的查阅各种设计模式的用法及注意点,希望对大家有所帮助。...
java 23种设计模式的类图 java 23种设计模式的类图 java 23种设计模式的类图
java常用设计模式及JDK与CGLIB实现动态代理区别(源码) /** * 使用cglib动态代理 * @author * */ public class BookFacadeProxy implements MethodInterceptor{ private Object target; @Override public...
sun Java JDK6.0的源代码,JDK类库源码.java jdk使用了大量的设计模式,开发学习必备神器
设计模式之观察者模式Java版本实现和UML类设计图
23个经典JDK设计模式 下面是JDK中有关23个经典设计模式的示例: Structural(结构模式) Adapter: 把一个接口或是类变成另外一种。 ● java.util.Arrays#asList() ● javax.swing.JTable(TableModel) ● java.io....
Java23个设计模式示例 项目版本信息: 1、当前版本1.0,创建时间:2016-07-28 编译信息: 1、编码格式为UTF-8 2、JDK版本为1.6 3、JUnit版本为4
设计模式(Design pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码...本文件中包含设计模式解释和spring与jdk中使用举例额,使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性。
Java设计模式——代理设计模式(静态代理和动态代理) 各种情况例子源码
java设计模式【之】JDK动态代理【源码】【场景:帮爸爸买菜】.rar /** * 代理模式 * 在开发者的角度来看,创建一个代理对象,提供给用户使用,避免用户直接访问真正的对象 * 在用户角度来看,就是普通的类方法...
JDK中常见的设计模式之工厂模式JDK中常见的设计模式之工厂模式
java设计模式之策略模式实现源码
《Java多线程编程实战指南(设计模式篇)》采用Java(JDK1.6)语言和UML 为描述语言,并结合作者多年工作经历的相关实战案例,介绍了多线程环境下常用设计模式的来龙去脉:各个设计模式是什么样的及其典型的实际应用...
模板模式在 Collections 类中的应用我们前面提到,策略、模板、职责链三个模式常用在框架的设计中,提供框架的扩展点,让框架使用者,在不修改框架源码的情况
design-pattern:7大设计原则+ 23种设计模式(含UML类图)+设计模式在JDK中的源码分析Java语言
java的23种常用设计模式之外观模式,经典的例子解析。