ex7_15.txt
来自「j2ee core design patterns」· 文本 代码 · 共 44 行
TXT
44 行
Example 7.15 OrderAppService
public class OrderAppService {
public OrderAppService() {
}
public void placeOrder(OrderTO orderTO)
throws AccountException {
Company company = null;
Account account = null;
String companyId = orderTO.companyId;
String accountId = orderTO.accountId;
// Lookup Company
company = getCompany(companyId);
// Lookup account
account = company.getAccount(accountId);
// add the order to the account
Order order = new Order(orderTO);
// calculate discount
calculateDiscount(company, account, order);
account.addOrder(order);
AccountManager accountManager =
account.getAccountManager();
// Send email to Account Manager notifying the
// new order
EmailAppService emailAppService =
new EmailAppService();
emailAppService.notifyAccountManager(accountManager,
order);
}
public void calculateDiscount(Company company,
Account account, Order order) {
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?