Java Case Study Framework - I
Java Case Study Framework - I
Objectives
To understand the concept of framework in application development.
Areas of application for Abstract classes, abstract methods etc.
Polymorphism and its uses,
Final fields and Lazy Initialization
Getter and Setter methods
Lazy Binding of methods
<<ABSTRACT>>
Framework BankAcc
-int accNo
-int accNm
<<ABSTRACT>> -int accBal
BankFactory
+void withdraw(float)
SavingAcc getNewSavingAccount() +void deposite(float)
CurrentAcc getNewCurrentAccount() +String toString()
<<ABSTRACT>> <<ABSTRACT>>
SavingAcc CurrentAcc
+boolean isSalary float creditLimit
+void withdraw(float) +void withdraw(float)
+String toString() +String toString()
SavingAcc getNewSavingAccount()
+void withdraw(float) +void withdraw(float)
CurrentAcc getNewCurrentAccount()
+String toString() +String toString()
Page 1 of 3
1. Abstract BankAcc: An abstract class to represent a bank account.
Fields Access Type Property
accNo private int Read Only
accNm private String Read-Write
accBal private float Read Only
Page 2 of 3
Methods Access Return Type Parameters
getNewSavingAcc public SavingAcc AccNo, accNm, accBal, isSalaried
getNewCurrentAcc public CurrentAcc AccNo, accNm, accBal,
creditLimit
8. The Entry point for application part: Design an entry point for the application to
test working of a framework.
a. Assign instance of MMBankFactory to BankFactory reference.
b. Instantiate MMSavingAcc and refer it through reference SavingAcc.
c. Instantiate MMCurrentAcc and refer it through reference CurrentAcc.
d. Invoke withdraw() method.
e. Invoke toString() method.
Page 3 of 3