> For the complete documentation index, see [llms.txt](https://innofang.gitbook.io/oh-my-design-patterns/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://innofang.gitbook.io/oh-my-design-patterns/readme.md).

# Oh, my design patterns

[![](https://i.creativecommons.org/l/by-nc/4.0/80x15.png)](https://github.com/InnoFang/oh-my-design-patterns/blob/master/LICENSE/README.md)

记录了我学习设计模式时写的文章以及代码。若有纰漏，欢迎指正与交流。😀

点击查看电子书，体验更好    👉 [gitbook](https://innofang.gitbook.io/oh-my-design-patterns/v/gitbook/)

<br>

* **创建型 (Creational)**
  * [工厂方法模式（Factory Method Pattern）](/oh-my-design-patterns/src/io/innofang/factory_method.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/factory_method/example/java/README.md) [`Kotlin`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/factory_method/example/kotlin/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/factory_method/main.cpp)
  * [抽象工厂模式（Abstract Factory Pattern）](/oh-my-design-patterns/src/io/innofang/abstract_factory.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/abstract_factory/example/java/README.md) [`Kotlin`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/abstract_factory/example/kotlin/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/abstract_factory/main.cpp)
  * [建造者模式（Builder Pattern）](/oh-my-design-patterns/src/io/innofang/builder.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/builder/example/java/README.md) [`Kotlin`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/builder/example/kotlin/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/builder/main.cpp)
  * [原型模式（Prototype Pattern）](/oh-my-design-patterns/src/io/innofang/prototype.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/prototype/example/java/README.md) [`Kotlin`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/prototype/example/kotlin/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/prototype/main.cpp)
  * [单例模式（Singleton Pattern）](/oh-my-design-patterns/src/io/innofang/singleton.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/singleton/example/java/README.md) [`Kotlin`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/singleton/example/kotlin/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/singleton/main.cpp)

<br>

* **结构型（Structural）**
  * [适配器模式（Adapter Class/Object Pattern）](/oh-my-design-patterns/src/io/innofang/adapter.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/adapter/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/adapter/main.cpp)
  * 桥接模式（Bridge Pattern）\
    &#x20;
  * 组合模式（Composite Pattern）\
    &#x20;
  * [装饰模式（Decorator Pattern）](/oh-my-design-patterns/src/io/innofang/decorator.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/decorator/example/java/README.md) [`Kotlin`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/decorator/example/kotlin/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/decorator/main.cpp)
  * [外观模式（Facade Pattern）](/oh-my-design-patterns/src/io/innofang/facade.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/facade/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/facade/main.cpp)
  * [享元模式（Flyweight Pattern）](/oh-my-design-patterns/src/io/innofang/flyweight.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/flyweight/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/flyweight/main.cpp)
  * [代理模式（Proxy Pattern）](/oh-my-design-patterns/src/io/innofang/proxy.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/proxy/example/java/README.md) [`Kotlin`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/proxy/example/kotlin/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/proxy/main.cpp)

<br>

* **行为型（Behavioral）**
  * 解释器模式（Interpreter Pattern）\
    &#x20;
  * [模板方法模式（Template Method Pattern）](/oh-my-design-patterns/src/io/innofang/template_method.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/template_method/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/template/main.cpp)
  * [责任链模式（Chain of Responsibility Pattern）](/oh-my-design-patterns/src/io/innofang/chain_of_responsibility.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/chain_of_responsibility/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/chain_of_responsibility/main.cpp)
  * 命令模式（Command Pattern）\
    &#x20;
  * [迭代器模式（Iterator Pattern）](/oh-my-design-patterns/src/io/innofang/iterator.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/iterator/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/iterator/main.cpp)
  * 中介者模式（Mediator Pattern）\
    &#x20;
  * [备忘录模式（Memento Pattern）](/oh-my-design-patterns/src/io/innofang/memento.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/memento/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/memento/main.cpp)
  * [观察者模式（Observer Pattern）](/oh-my-design-patterns/src/io/innofang/observer.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/observer/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/observer/main.cpp)
  * [状态模式（State Pattern）](/oh-my-design-patterns/src/io/innofang/state.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/state/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/state/main.cpp)
  * [策略模式（Strategy Pattern）](/oh-my-design-patterns/src/io/innofang/strategy.md)\
    [`Java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/strategy/example/Java/README.md) [`Kotlin`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/strategy/example/kotlin/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/strategy/main.cpp)
  * [访问者模式（Visitor Pattern）](/oh-my-design-patterns/src/io/innofang/visitor.md)\
    [`java`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/src/io/innofang/visitor/example/README.md) [`C++`](https://github.com/InnoFang/oh-my-design-patterns/blob/master/cpp/visitor/main.cpp)

## License

[![Creative Commons License](https://i.creativecommons.org/l/by-nc/4.0/88x31.png)](http://creativecommons.org/licenses/by-nc/4.0/)\
This work is licensed under a [Creative Commons Attribution-NonCommercial 4.0 International License](http://creativecommons.org/licenses/by-nc/4.0/).

本作品采用[知识共享署名-非商业性使用 4.0 国际许可协议](http://creativecommons.org/licenses/by-nc/4.0/)进行许可。
