Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

The Spring series, Part 1: Introduction to the Spring framework

A first look at Spring AOP and the IOC container

Return to article

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);


   }

Return to article.