命令模式(Command)
2019-05-12 11:02:20 7 举报
命令模式(Command)
作者其他创作
大纲/内容
命令模式:将一个请求封装为一个对象,从而使你可用不同的请求对客户进行参数化
Command
- receiver:Receiver
+ Command(receiver:Receiver)+ execute(obj:Object):Object
DeleteCommand
+ DeleteCommand(receiver:Receiver)+ execute(obj:Object):Object
ChangeCommand
+ ChangeCommand(receiver:Receiver)+ execute(obj:Object):Object
AddCommand
+ AddCommand(receiver:Receiver)+ execute(obj:Object):Object
FindCommand
+ FindCommand(receiver:Receiver)+ execute(obj:Object):Object
Invoker
- command:Command
+ setCommand(command:Command):void+ execute(obj:Object)Object
Receiver
+ add(obj:Object):Object+ delete(obj:Object):Object+ change(obj:Object):Object+ find(obj:Object):Object
调用者
命令
执行者
0 条评论
下一页