# Design Patterns 设计模式 **Repository Path**: carbon-studio/design-patterns ## Basic Information - **Project Name**: Design Patterns 设计模式 - **Description**: 🏗️一站式学习、对比与实战:C++ & Java 语言讲解全部 23 种 GoF 设计模式 + 综合架构场景 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-04 - **Last Updated**: 2025-09-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: 设计模式, Cpp, Java ## README # 🏗️ Design-Patterns-Hub 设计模式 ***一站式学习、对比与实战:C++ & Java 语言讲解全部 23 种 GoF 设计模式 + 综合架构场景*** #### 📌 仓库公告 https://gitee.com/carbon-studio/design-patterns.git #### 🎯 愿景 让“设计模式”不再停留在概念,而成为日常开发随手可插拔的**真·工具箱**。 ⭐ **如果本仓库帮到了你,给个 Star 再走呗~** ⭐ #### 📂 仓库结构 ``` Design Patterns/ ├── DP-Cpp/ # 23 种 GoF 模式源码C++示例 │ ├── strategyPattern/ | | ├── Demo.cpp | | ├── context/ | | └── Strategy/ │ ├── observerPattern/ │ ├── statePattern/ │ └── ... ├── DP-Java/ # 23 种 GoF 模式源码Java示例 │ ├── strategyPattern/ │ ├── observerPattern/ │ └── ... ├── README/ └── LICENSE/ ``` #### 🚀 5 秒起步 ```bash git clone https://gitee.com/carbon-studio/design-patterns.git cd design-patterns ``` > PS:所有示例 **零第三方库依赖** #### 🧩 模式列表(持续更新 ✅) | 类型 | 模式 | | :--------: | :----------------------------------------------------------: | | **创建型** | 工厂Factory✅/ 抽象工厂Abstract Factory✅ / 建造者Builder✅ / 原型Prototype ✅/ 单例Singleton✅ | | **结构型** | 适配器Adapter✅ / 桥接Bridge✅/ 组合Composite✅/ 装饰器Decorator✅ / 外观Facade🚧/ 享元Flyweight🚧 / 代理Proxy🚧 | | **行为型** | 策略Strategy✅/ 观察者Observer🚧 / 命令Command🚧 / 迭代器Iterator🚧 / 模板Template🚧 / 状态State 🚧/ 责任链Chain 🚧/ 访问者Visitor🚧 / 中介者Mediator 🚧/ 备忘录Memento🚧 / 解释器Interpreter🚧 | #### 🎓 如何使用本仓库 1. **速查** → 打开 `cheatsheet/CHT-zh.md` 按场景找模式。 2. **单个模式** → 进 `patterns/序号-模式名/` 直接看 `Demo.java` & `README.md`。 3. **架构级实战** → 进 `scenarios/` 阅读多模式联用思路 + 完整 UML。 4. **贡献** → 按 `template/` 新建模块,提 PR 即可。 #### 🤝 贡献指南 我们欢迎: - 新增模式示例(请跟随 `template/` 目录结构) - 补充“综合场景”真实业务 case - 改进文档、翻译、错别字 请先 Fork → 新建分支 → 提交 PR,3 日内必 review。 #### 📬 联系 - Issue:任何疑问/错误请直接提 Issue - 讨论区:分享你在实际项目里的模式使用心得 ---