Skip to content

Commit 894fd4a

Browse files
committed
Update public notes
1 parent 7119c05 commit 894fd4a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

content/编程相关/OOP/OOP 世界观.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,18 @@ IOP 强调定义和实现分离,通过接口进行约束。
6666

6767
### 面向切面编程 Aspect Oriented Programming
6868

69-
AOP 强调的是逻辑上的「**切面**」,也就是所谓的注意点分离
69+
AOP 强调的是逻辑上的「**切面**」,也就是所谓的**注意点分离**
7070

7171
比如说我要写一个函数。如果要考虑实现、日志、安全、报错后怎么处理……等等这些问题,就会导致这个函数职责过多,变得臃肿。因此完全可以在逻辑上将日志、安全、报错拆出去,让函数只关注本应有的实现。
7272

73-
AOP 依赖注解和代码生成。
73+
AOP 依赖注解和代码生成。
74+
75+
比如说游戏开发的多人联机框架例如 mirror,可以看到这种注解:
76+
77+
```c#
78+
public class Player: NetworkBehaviour {
79+
[SyncVar] public int health = 100; // 自动同步字段并且只能在服务器端被修改.
80+
}
81+
```
82+
83+
这就是一种 AOP 的实现,使用框架的用户无需关注具体怎么进行网络通信,只用关注游戏逻辑怎么写,在写完逻辑之后用注解让框架自动生成网络通信的代码,达到**注意点分离**的效果。

content/软件开发方式.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
created: "2025-12-08"
3+
updated: "2025-12-08"
4+
---
5+
#todo DDD TDD ATDD IDD

0 commit comments

Comments
 (0)