随笔 - 52  文章 - 50  评论 - 1  阅读 - 24839

随笔分类 -  设计模式

常用网站
摘要:设计模式 https://design-patterns.readthedocs.io/zh_CN/latest/structural_patterns/adapter.html 23种设计模式 https://design-patterns.readthedocs.io/zh_CN/latest/ 阅读全文
posted @ 2024-01-27 01:27 蜀山菜鸟 阅读(7) 评论(0) 推荐(0) 编辑
适配器,桥接,代理,享元模式示例代码
摘要:适配器模式: // 适配器模式 将一个类的接口转换成客户希望的另外一个接口 // 接口层 class OutInterface { public: virtual ~OutInterface() = default; // 客户希望实现的接口 例如: 用户希望一次性打印姓名 年龄 成绩 virtua 阅读全文
posted @ 2022-05-19 14:57 蜀山菜鸟 阅读(30) 评论(0) 推荐(0) 编辑
代理模式
摘要:class Service { public: int QueryData() { // 服务端,查询数据,订阅数据,修改数据等 cout << "this is service data" << endl; return 0; } }; class CProxy { private: CProxy 阅读全文
posted @ 2022-05-16 21:35 蜀山菜鸟 阅读(18) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示