Auto-sync: 2026-04-17 08:37

This commit is contained in:
2026-04-17 08:38:12 +08:00
parent 6caa1c2f47
commit a0a48bd334
247 changed files with 6577 additions and 3061 deletions

View File

@@ -0,0 +1,22 @@
---
title: "单一职责"
type: concept
tags: []
---
## Definition
每个文件、每个类、每个函数应只负责一件事。这是软件设计的基本原则之一。
## Key Points
- 一个函数只处理一个任务
- 提炼公共逻辑避免重复代码DRY
- 模块化、函数化,提高复用价值
- 明确区分输入 → 处理 → 输出
## Source
- [[kai-fa-jing-yan-yu-xiang-mu-gui-fan-zheng-li-wen-dang]]
## Related Concepts
- [[DRY 原则]]
- [[模块化]]
- [[函数式编程]]