java代码
class FinallyCommand implements Command{
private final Command c;
private final Command c;
public Object execute(CommandContext ctxt){
try{
return cexecute(ctxt);
}
finally{
cexecute(ctxt);
}
}
FinallyCommand (Command c Command ){
thisc = c;
thisc = c;
}
}
前面的顺序执行我们是直接扔掉了前一个command的返回值但是有些时候我们也许希望根据第一个command的返回值来决定下一步的走向为此仿照CommandRecovery接口定义CommandBinder接口
[] [] [] [] [] [] [] [] [] [] []