// kontroler aplikacji ze sterowaniem przepywem
 
public class ApplicationControllerImpl implements ApplicationController {
 
  public ResponseContext handleRequest(Map requestContextMap) {
    ResponseContext responseContext = null;
    try {
 
      // pobranie kolejnoci operacji przetwarzania z ContextObject
      String orderEvent = getOrderEvent(requestContextMap);
      String orderState = getOrderState(requestContextMap);
 
      // utworzenie polecenia bazujcego na zdarzeniu biznesowym i aktualnym stanie
      CommandAndViewFactory factory = CommandAndViewFactory.getInstance();
      CommandViewHandle result = factory.getCommand(orderEvent, orderState);
 
      // utworzenie instancji polecenia z uchwytu poredniego
      Command command = (Command)result.getCommandHandle().newInstance();
 
      // wykonanie usugi warstwy biznesowej
      responseContext = command.execute(requestContextMap);
      // ustawienie nazwy widoku
      responseContext.setLogicalViewName(result.getViewName());
    } catch(Exsception e) {
      // obsuga wyjtku
    }
    return responseContext;
  }
  ...
  private String getOrderStatus(Map requestContext) {
    String id = ((String[])requestContext.get(OrderStatus.STATUS_PARAM))[0];
    return id;
  }
 
  private String getOrderEvent(Map requestContext) {
    String orderEvent = ((String[])requestContext.get(Constants.REQ_OPCODE))[0];
    return orderEvent;
  }
}
