📄 ex6_72.txt
字号:
Example 6.72 ViewAccountDetailsCommand
public class AccountCommand implements Command {
public AccountCommand() { }
// view account details operation
public ResponseContext execute(RequestContext requestContext) {
String accountId =
requestContext.getStringParameter("AccountId");
/** Use an business delegate to retrieve data
* from application service, and store result
* in a response object.
* Note: Object creation could be avoided via
* factory, but for example purposes object
* instantiation is shown **/
AccountDelegate delegate = new AccountDelegate();
AccountTO accountTO;
accountTO= delegate.getAccountProfile(accountId);
// This info could come from biz-tier components
String logicalViewName = "AccountProfile";
ResponseContextFactory factory =
ResponseContextFactory.getInstance();
ResponseContext responseContext =
factory.createResponseContext(accountTO, logicalViewName);
return responseContext;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -