---
title: "一个学习设计模式的好资源"
description: "推荐设计模式学习网站Refactoring Guru，其为每种模式配有直观插图与简明定义，看图即可理解模式意图，多数情况下浏览网站内容即可无需购书。"
date: 2020-04-06T04:15:27Z
canonical: https://xiaobox.github.io/p/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/
author: 小盒子
categories: ["架构与方法"]
tags: ["设计模式"]
source: https://mp.weixin.qq.com/s/Y18kq1Cy3cZfMyUGnmidWg
license: CC BY-NC-SA 4.0
license_url: https://creativecommons.org/licenses/by-nc-sa/4.0/
---

# 一个学习设计模式的好资源

![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/001-215666a3.png)

https://refactoringguru.cn/design-patterns 

上面是网站地址，不说别的，光是图画的就深得我心。![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/002-bb269594.png)

贴几个大家感受下：

工厂方法模式是一种创建型设计模式， 其在父类中提供一个创建对象的接口， 允许子类决定实例化对象的类型。

![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/003-c9bdaf9c.png)

抽象工厂模式是一种创建型设计模式， 它能创建一系列相关的对象， 而无需指定其具体类。

![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/004-2ca0bc14.png)

生成器模式是一种创建型设计模式， 使你能够分步骤创建复杂对象。 该模式允许你使用相同的创建代码生成不同类型和形式的对象。

![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/005-7594ad1e.png)

原型模式是一种创建型设计模式， 使你能够复制已有对象， 而又无需使代码依赖它们所属的类。

![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/006-a4b60b5a.png)

单例模式是一种创建型设计模式， 让你能够保证一个类只有一个实例， 并提供一个访问该实例的全局节点。

![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/007-d424dc2e.png)

适配器模式是一种结构型设计模式， 它能使接口不兼容的对象能够相互合作。

![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/008-b67bab67.png)

怎么样？还不错吧，有些模式光看图你就大概明白是怎么回事儿了。网站上也有它的电子书卖（注意，这不是广告，我也没拿钱啊![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/009-76280b2b.png)）。想买书的也可以买本来看看，不过我觉得看网站上的大部分内容应该就够了。

![Image](https://pub-f29bf2b53160470c9a85250116509a24.r2.dev/post/2020-04-06-yi-ge-xue-xi-she-ji-mo-shi-de-hao-zi-yuan/010-84e813ce.jpg)

关注公众号 获取更多精彩内容

