java代码
class SeqCommand implements Command{
private final Command c;
private final Command c;
public Object execute(CommandContext ctxt){
cexecute(ctxt);
return cexecute(ctxt);
}
SeqCommand (Command c Command c){
thisc = c;
thisc = c;
}
}
上面这个简单的Command就负责按照顺序执行连续的两个command
除了顺序执行还有错误处理我们也许会希望当某个步骤执行失败时去执行另外一个动作为此我们需要先定义一个接口来描述错误恢复
[] [] [] [] [] [] [] [] [] [] []