public interface ICustomerTransactions {

 //State-changing methods

 public void createPurchaseRecordForProduct(Long productId)

                     throws CustomerTransactionsSystemException;

 public void loadAllPurchaseRecords()

                     throws CustomerTransactionsSystemException;

 //Behavior method

 public void isCustomerEligibleForDiscount();

}

????????μ????????洢??????????????????????????????????????仯????????????????????????????????????????????????????????е??????????Ч????μ?????????Щ?·???????????????ICustomerAccount????CustomerAccount?????????????

public interface ICustomerAccount {

 //State-changing methods

 public void createNewActiveAccount()

                   throws CustomerAccountsSystemOutageException;

 public void loadAccountStatus()

                   throws CustomerAccountsSystemOutageException;

 public void createPurchaseRecordForProduct(Long productId)

                   throws CustomerAccountsSystemOutageException;

 public void loadAllPurchaseRecords()

                   throws CustomerAccountsSystemOutageException;

 //Behavior methods

 public boolean isRequestedUsernameValid();

 public boolean isRequestedPasswordValid();

 public boolean isActiveForPurchasing();

 public String getPostLogonMessage();

 public void isCustomerEligibleForDiscount();

}

?????????濴????????????????????????κ????????????????????????????????????????????Ч???????????????????????????????????????????????????е????С?????????????Щ??
 
???????4?????????????С??????????

????????????????????????????С???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????洢?豸????????????????г????????????????????????????????????????????????????Щ??????????????????????????????????????????????????????磬getPostLogonMessage()?????????accountStatus??????????????

public String getPostLogonMessage() {

 if("A".equals(this.accountStatus)){

    return "Your purchasing account is active.";

 } else if("E".equals(this.accountStatus)) {

    return "Your purchasing account has " +

           "expired due to a lack of activity.";

 } else {

    return "Your purchasing account cannot be " +

           "found?? please call customer service "+

           "for assistance.";

 }

}