diff --git a/notes/pics/dp-command.png b/notes/pics/dp-command.png new file mode 100644 index 00000000..19bcc218 Binary files /dev/null and b/notes/pics/dp-command.png differ diff --git a/notes/设计模式 - 命令.md b/notes/设计模式 - 命令.md index a5fea7fe..4fe0fdef 100644 --- a/notes/设计模式 - 命令.md +++ b/notes/设计模式 - 命令.md @@ -1,7 +1,6 @@ ## 2. 命令(Command) -### Intent - +### 意图 将命令封装成对象中,具有以下作用: - 使用命令来参数化其它对象 @@ -9,17 +8,15 @@ - 将命令的操作记录到日志中 - 支持可撤销的操作 -### Class Diagram - +### 类图 - Command:命令 - Receiver:命令接收者,也就是命令真正的执行者 - Invoker:通过它来调用命令 - Client:可以设置命令与命令的接收者 -