This assignment will assess your ability to:
1. Annotate your code with contracts.
2. Implement and use a generic collection class.
3. Construct a UML diagram of Model-View-Controller and explain the characteristics of MVC.
4. Construct a GUI according to the Model-View-Controller design pattern.
A Bank-GUI has been designed with the following facilities. There is a provision to open accounts, Savings Account and Current Account. Bank-GUI also has provision to display the detail of the account.
Opening a savings account needs IC number, Customer's name, address, date of birth, date of opening the account and an account number is also allotted.
Opening a current account needs IC number, Customer's name, address, date of birth, date of opening the account, an account number and minimum amount to be retained in the account.
Savings account number and Current account number are different.
1. Explain the functioning and use of Model-View-Controller design pattern in pattern oriented software architecture with reference to Bank-GUI.
2. Draw the UML Class/Object diagram of MVC.
3. Write a program implementing a GUI according to the Model-View-Controller design pattern. The program should consist of the following classes. See below for further details.
a. Definition of Model class.
b. Definition of Control class.
c. Definition of View class.
d. Complete Program.
4. List and describe the generic classes to be used in the proposed GUI.
5. Provide the assertion for the precondition and post condition used in each contract.
6. Use suitable names of methods, variable names, code layout and necessary comment statements etc.
TOTAL [100 MARKS]
INTRODUCTION TO TASK 3
You are to write a program in Java implementing a Graphical User Interface for a bank. The proposed design for the GUI is as shown below. There is a provision to choose either a Saving Account or Current Account by means of two buttons:
Saving Account Current Account
Pressing one of the buttons leads to the appearance of three further buttons:
Add, Display and Exit as shown below:
Add Display Exit
The actions of the buttons are as follows:
(1) Add - to add customers in a selected account.
(3) Display - to display the account detail of a selected account.
(4) Exit - to quit the existing GUI.
DETAIL OF GUI DESIGN
The Savings Account and Current Account have the following data fields.
Add Customer in Saving Account
Add Customer in Current Account
Be warned that a “working” program that fails to satisfy any of these Learning Outcomes will get a very low mark. The purpose of this module is not to teach you Java, so if knowledge of Java is all you demonstrate in your submission then you have not learned much and we cannot give you much credit.
REQUIRED STRUCTURE OF PROGRAM
You should write classes Bank-GUI-Model, Bank-GUI-View, and Bank-GUI-Controller to follow the Model-View-Controller pattern. To clarify, this means that
o Bank-GUI-View must be the only class containing GUI code,
o Bank-GUI-Model must store all the data and have no references to the other two classes and
o Bank-GUI-Controller must forward only valid requests to Bank-GUI-Model and it must tell Bank-GUI-View to disable buttons and show alerts in response to incorrect inputs.
Assignment submission will be checked against detection software and work found to have been plagiarized will be referred to Plagiarism Committee.