public class ApplicationControllerImpl implements ApplicationController {
 
  public void initialize() {
    commandMapper = CommandMapper.getInstance();
  }
 
  public ResponseContext handleRequest(RequestContext requestContext) {
    ResponseContext responseContext = null;
    try {
      // walidacja parametrw dania
      requestContext.validate();
 
      // przeksztacenie nazwy polecenia na informacje dla obiektu Command
      String commandName = requestConttext.getCommandName();
      Command command = commandMapper.getCommand(commandName);
 
      // wykonanie polecenia
      responseContext = command.execute(requestContext);
 
      // okrelenie nazwy widoku
      CommandMap = mapEntry = commandMapper.getCommandMap(commandName);
      String viewName = mapEntry.getViewName();
      responseContext.setLogicalViewName(viewName);
    } catch (ValidatorException e1) {
      // obsuga wyjtku
    }
    return responseContext;
  }
  ...
}
