⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex7_14.txt

📁 j2ee core design patterns
💻 TXT
字号:
Example 7.14 	CustomerAppService

public class CompanyAppService {

    public void addCompany(CompanyTO companyTO) {
        Company customer = new Company(companyTO);
        // Persist customer
    }

    public void addAccount(String companyId,
        AccountTO accountTO) {
    throws AccountException {

        Company company = null;
        // Get Company
        // company = findCompany(companyId);

        if (company == null)
            throw new AccountException(
               "Company Id: " + companyId + " doesn't exist");

        Account account = new Account(accountTO);
        company.addAccount(account);

        AccountManager accountManager = null;
        accountManager = getAccountManager(company.getZip());
        account.addAccountManager(accountManager);

        // Send email to Account Manager notifying the
        // new account
        EmailAppService emailAppService =
            new EmailAppService();
        emailAppService.notifyAccountManager(accountManager,
            account);
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -