Akif Islam
Department of CSE, University of Rajshahi
iamakifislam@gmail.com
Write a Java program that demonstrate the implementation of a facade design pattern for a Banking Service with Cheaquing, Saving, and Investment modules.
The Facade pattern is a structural design pattern that provides a simplified interface to a complex subsystem, making it easier to use.
$javac FacadePatternDemo.java
$java FacadePatternDemo
// Creating My Bank Account, Deposit 5000, Withdraw 1400
BankService myBankService = new BankService();
myBankService.createAccount("Savings");
myBankService.deposit(5000);
myBankService.checkBalance();
myBankService.withdraw(1400);
myBankService.checkBalance();
// Transfer Money from My Account to Another Account
System.out.println("\n\n**AnotherAccount Logged In**");
BankService anotherBankService = new BankService();
anotherBankService.createAccount("Investment");
myBankService.transfer(anotherBankService,3000);
anotherBankService.checkBalance();