📄 ex7_15.txt
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -