Invoker的invokeCommand()用来给Client调用,内部执行
Invoker:abst
+ command:type = Command
+ setCommand(Command):void+ invokeCommand():void
Client创建的时候需要指定Invoker,创建命令里面需要调用invoker.setCommand()方法保存该Command
创建Command对象的时候需要传入Receiver对象,对外提供excute、undo接口,实际上是调用Receiver
Command:abst
+ receiver:type = receiver
+ excute():void+ undo():void
Client:abst
+ invoker:type = Invoker
+ createCommand(params):void
Receiver
+ lightOn():void+ lightOff():void