IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope: Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    

developerWorks 中国  >  Java technology  >

Spring 系列: Spring 框架简介

Spring AOP 和 IOC 容器入门

developerWorks

返回文章

When you print this page, select the landscape layout option.


Listing 6. CreateCreditCardAccount


   public class CreateCreditCardAccount implements 
   CreateCreditCardAccountInterface {

   public CreditLinkingInterface getCreditLinkingInterface() {
   return creditLinkingInterface;
   }


   public void setCreditLinkingInterface(
   CreditLinkingInterface creditLinkingInterface) {
   this.creditLinkingInterface = creditLinkingInterface;
   }


   public CreditRatingInterface getCreditRatingInterface() {
   return creditRatingInterface;
   }


   public void setCreditRatingInterface(CreditRatingInterface creditRatingInterface)   
   {
   this.creditRatingInterface = creditRatingInterface;
   }


   public EmailInterface getEmailInterface() {
   return emailInterface;
   }


   public void setEmailInterface(EmailInterface emailInterface) {
   this.emailInterface = emailInterface;
   }


   //Client will call this method
   public void createCreditCardAccount(ICustomer icustomer) throws Exception{
         boolean crediRating = 
         getCreditRatingInterface().getUserCreditHistoryInformation(icustomer);
         icustomer.setCreditRating(crediRating);
         //Good Rating
         if(crediRating){
         getCreditLinkingInterface().linkCreditBankAccount(icustomer);
         }

         getEmailInterface().sendEmail(icustomer);


   }

返回文章


    关于 IBM隐私条约联系 IBM