使用 TypeScript 编写示例,介绍 23 种设计模式,包括以下内容:
- 5 种创建型:创建对象,隐藏实现。
- 7 种结构型:关注类和对象的组合。
- 11 种行为型:关注对象之间的通信。
参考资料: 一些代码实现
- PHP https://github.com/kamranahmedse/design-patterns-for-humans
- Java https://github.com/RefactoringGuru/design-patterns-java
- Python https://github.com/gennad/Design-Patterns-in-Python
- JS https://github.com/tcorral/Design-Patterns-in-Javascript
- TS https://github.com/torokmark/design_patterns_in_typescript
一些文字介绍