通过查询资料,整理了23种设计模式的Java实现,并将各种设计模式的思想及与其他设计模式的比较,适用范围以注释的形式记录在类实现中。
目前整理的设计模式有:
1.创建型模式
设计模式名称 | 设计模式名称 | 设计模式名称 | 设计模式名称 |
---|---|---|---|
抽象工厂 | 生成器 | 工厂方法 | 原型 |
单例 |
设计模式名称 | 设计模式名称 | 设计模式名称 | 设计模式名称 |
---|---|---|---|
适配器 | 桥接 | 组成 | 装饰 |
外观 | 享元 | 代理 |
设计模式名称 | 设计模式名称 | 设计模式名称 | 设计模式名称 |
---|---|---|---|
职责链 | 命令 | 解释器 | 迭代器 |
中介者 | 备忘录 | 观察者 | 状态 |
策略 | 模板方法 | 访问者 |
还有打鱼还是晒网大神(其中代码绝对大部分来自于他)的博客:
欢迎大家加入,一起整理更多更有用的设计模式。