Skip to content

初学设计模式,使用C++复现《大话设计模式》中的各个模式。

License

Notifications You must be signed in to change notification settings

muyuuuu/Design-Pattern

Repository files navigation

C++ 复现《大话设计模式》,有代码的复现,讲理论的就不复现了。对于不含代码的理论知识,如果你开发过大型程序,一定知道作者在说什么。每个模式中会有一个 README 来介绍这种模式适用的场景,但不会细讲,如果企图读懂模式的思想请阅读专业教材。

2021年3月30日开始,中间出了点故障,就当5月5日学完吧,后期会整理到博客。

注意:只关注模式本身,某些细节、异常等没有处理。

文件夹 模式名称 是否含代码
Factory mode 简单工厂模式 ✔️
Strategy mode 策略模式 ✔️
Single responsibility principle 单一职责原则
Open-Closed Principle 开闭原则
Dependency inversion principle 依赖倒转原则
Decoration mode 装饰模式 ✔️
Proxy mode 代理模式 ✔️
Factory Method Pattern 工厂方法模式 ✔️
Prototype Pattern 原型模式 ✔️
Template Method Pattern 模板方法模式 ✔️
Law of Demeter 迪米特法则
Facade Pattern 外观模式 ✔️
Builder Pattern 建造者模式 ✔️
Subscribe Pattern 观察者模式 ✔️
Abstract Factory Pattern 抽象工厂模式 ✔️
State Pattern 状态模式 ✔️
Adapter Pattern 适配器模式 ✔️
Memento Pattern 备忘录模式 ✔️
Composite Pattern 组合模式 ✔️
Iterator Pattern 迭代器模式 ✔️
Singleton Pattern 单例模式 ✔️
Bridge Pattern 桥接模式 ✔️
Command Pattern 命令模式 ✔️
Mediator Pattern 中介者模式 ✔️
Flyweight Pattern 享元模式 ✔️
Interpreter Pattern 解释器模式 ✔️
Visitor Pattern 访问者模式 ✔️

遗留

  • 抽象工厂模式中反射的 C++ 实现
  • 状态模式中的 bug 修复,与日后的 C++ 整理放到一起
  • 中介者模式的 bug 修复,同上述问题是同一个 bug
  • 访问者模式的 bug 修复,同上述问题是同一个 bug

About

初学设计模式,使用C++复现《大话设计模式》中的各个模式。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published