Comments 0

Presentation transcript

Redtea

2009

ATM SIMULATORPROJECT

This is the report that is produced by “Redtea Team” in which reflects our workfrom analysis step to shippable product step. Also, in this document, the readercan easily see all the design patterns that had been applied to this project alongwith its descriptions.

We have to implement both “ATM client” and “server”and simulate the basic transactions of the “Automated teller machine”.

-

NetBeans IDE 6.5.1 will be the development environment and using scrum to manage the project.

-

“ATM simulator and server” project will be divide into two phases. First phase will concentrate on develop the back-endserver, the centralization of all of the transactions. Second phase will be developed the front-end ATM. In addition, we haveto simulate both the interface and hardware of an ATM.

-

Bank account can contain any kind of currency such as USD, VND, AUD, and so on. However, once it was created, it has tohave maintained that currency for the life time of that account and each of bank account can only be opened by onecustomer and each of the bank account has different behavior. For example, saving account would behave differently tomoney market account.

-

“ATM card” is used to access to a bank account through ATM. ATM card can be linked to more than one account, however,that ATM card will have a default account and the default account will be browse at the beginning. An ATM card is acombination of 16 digits ID and 3 special digits as PIN. One account can have more than 1 ATM card with the same 16 digitsID; however, the 3 special digits must be different.

-

To use ATM, customer place their card into card reader and the customer only need to input the PIN number. The session isstarted when customer place their cart into card reader and finish when customer press reject button on ATM to get theATM card back.

-

ATM Client should beable to support both console and graphical interface. In order work, the project should have thereusability, follow the OO principal and keep in mind: “close for modification but open for extension”.

-

Some of the basic required transaction:

Redtea

Page5

CONFIDENTIAL3/15/2013

o

Transfer money

o

Deposit money

o

Withdraw money

o

Exchange money

o

Check account balance

-

The deadline of the project will be 02/09/2009; this project started from 22/06/2009 and was given by Mr. Eric.

1.1.

Requirements

-

Deposit Money

–

A customer can deposit money to a specific account. If the customer owns multiple accounts, the customeris able to choose which account to deposit to. You need to be able to simulate the process of a deposit. That includes anyhardware that may be used to accept a deposit. Note: deposits are usually placed in a standard envelope which is given tothe machine.

-

Withdraw Cash

–

A customer can withdraw cash from an account. An exchange is required if the currency withdrawn isn’tthe same as the account being withdrawn from. If the customer has multiple accounts, the customer is able to choose whichaccount to withdraw from. Remember to consider the hardware aspects of the ABT. Think about what happens in the ATMmachine when it doesn’t have enough money. What happens if the hardware breaks? Can they withdraw any kind ofcurrency denomination?

-

Check Balance

–

Get the balance of an account. The user can also get a balance of all accounts linked to the card

-

Support Multiple Linked Accounts

–

An ATM card, as mentioned above, can be linked tomultiple accounts.

-

Currency

–

An account can have difference currency but once created must maintain that type of currency.

-

Notification

–

After a transaction, if an account has reached a pre-determined level, a notification is automatically sent to theaccount holders email address.

Redtea

Page6

CONFIDENTIAL3/15/2013

-

Balance Notification

–

After a transaction, if an account has reached a pre-determined level, a notification is automaticallysent to the account holders email address.

-

Stat Session–

To start using an ATM, the customer inserts their card. They only need to enter a Personal IdentificationNumber (PIN) for verification.

-

Finish Session

–

When the customer is finished using the ATM, they can choose to finish their session. The ATM will returntheir card.

-

ATM User-Interfaces

–

We have two types of ATMs. One type of ATM is GUI based and the other type is text based. We needto easily support both of them and still re-use source code specific to the ATM process.

-

Communication

–

We need to easily communicate with our server; however, we want this complete hidden from the objectsyou create. For example, when a user enters their PIN, we can simply code “Pin.Validate”. However, that command is reallybeing executed on the server in some mystical way.

-

Server:

o

Reporting Requirements

-

We have strict reporting requirements.

As such, in the case of a user error or computererror, we need to be able to handle these situations dynamically.

o

Redo/Undo and Logging

–

Every time a user takes an action within the ATM it has to be logged and time stampedwithin the central system. If someone, for example, enters their pin incorrectly, that will be logged. If they withdrawmoney, it will be logged, etc. There is a great pattern for this.

Split the whole project into smaller project without dependencies in each other. For example, the client and servercommunicate with each other through proxy object, a person who develop client can introduce new function with number ofparameters and leave a descriptionhow that method will be used, the purpose of each parameter and the expected resultfrom that method on the “IATMServer”, after that, that programmer can move on and suppose that the method workingalready. Then when the person who develops the actual server come to that point, that developer will finish the rest toproduce the expected result. In this scenario, the person who develop client does not care what happen at the server sideand vice versa. Thus, the work will twice faster than normal because we do not spend time to wait for one to another tofinish the job in order to move on.

-

With this pattern, our server can easily support other ATM client from other companies without modify a single line of codefrom either our server or their client. All they have to do is produce an adapter class to convert their current data into ours.

Redtea

Page16

CONFIDENTIAL3/15/2013

Redtea

Page17

CONFIDENTIAL3/15/2013

Command Pattern:

This pattern will helps us encapsulate each of transaction intoa single object. Thus whenever we want to modify an object toadapt to new type of transaction, we only modify that single object, and it will not affect other class in the system. Also,if wewant to introduce new kind of action, we just have to create new command object to act as the new type of action. In addition,this pattern support the undo function, thus, we can use it to undo an action that might have error on the system.

Redtea

Page18

CONFIDENTIAL3/15/2013

Redtea

Page19

CONFIDENTIAL3/15/2013

Decorator Pattern:

All the account will have the same basicattribute such as current balance, currency, and account type and so on. However, eachtype of account will behave differently, and each of account from each bank will be different as well. In order to implementthose different, we would have implement a thousand of thousand of class of account type. However, with this pattern, we onlyneed to createthe new wrapper type of new bank account, then encapsulate new behavior of that bank account as a singleobject (strategy pattern would be the best choice here) then put it inside the wrapper class and the problem will be solve.

Redtea

Page20

CONFIDENTIAL3/15/2013

Abstract Factory Method Pattern:

This pattern will help us control the creating new instance object of a class because if we use the “new” key work all over the place,it is not a good practice.

Redtea

Page21

CONFIDENTIAL3/15/2013

MVC Pattern:

For this pattern from the book, it actually isa

MVC Compound pattern. A set of different patterns applied.

By separating the roles into three parts, the View of the program is using theComposite pattern, because it has a lot of buttonsand panels to display.

Redtea

Page22

CONFIDENTIAL3/15/2013

The Controller class is usingStrategy pattern

to interact between the View and Model. When there is an event from the View,the controller will take process to the Model and notify the View to change. It implements the IController interface, and usesthese methods to control actions from View to Model.

Model class is the ATMClient, used to connect to the server and handle all logic executions.

However, the Observer pattern was not applied to this client, because in ATM systems, we only have a unique card to put in at atime. We do not have different screens for an account to see changes by the Observable interface.

The second reason is that we do not need to accomplish the ATM System Monitor. So that it is not reallynecessary to useObserver on client.

Redtea

Page23

CONFIDENTIAL3/15/2013

Observer Pattern:

The actions that interact between user and computerare

easilyhandled

because every time user click button or press a key, itwill trigger an event. But what if there is a change in the internal

of the program and we want to

notify the change to the user,how can we do it? We can use a thread to fulfill the job, however, the thread will run continuously and it cost a lot of resource.We can then reduce the priority of the thread and reduce the refresh rate by putting the thread in sleeping state. However, ifthere are 2 events occur in the sleeping period, then the user will not know. Here is where the observer pattern comes in; it

willnotify the observer immediately whenever there is a change from internal. Also, it take less memory to process compare to usingthread method.

Redtea

Page24

CONFIDENTIAL3/15/2013

Proxy Pattern:

Proxy pattern will help us completely hide the actual class from client and still, it makes the client believe that they areprocesslocally.

Redtea

Page25

CONFIDENTIAL3/15/2013

Singleton Pattern:

When we create an object, that object will only availablewithin the class that creates that instance. However, we want thatobject is available for every class that can access and still, decoupled between that object and other classes. The singleton will dothe job for us. In this particular problem, we use the command pattern to encapsulate each of the action and still, we do want towrite a log to a file for that action in such the time of the action occurs, the result of the action, and we do not want to see somany relationships all over the place. Thus, we singleton the controller class, this is the class that handle all the internal activity,and through observer pattern, we can write the new log to the log file.

Redtea

Page26

CONFIDENTIAL3/15/2013

State Pattern:

This is an important factor to maintain states when the user using the ATM. There are 5 states: Balance

When user selects an action, it will move to the desired state and run its duty. The othersmethods it will ignore and move to the next state. State pattern provides flexibility to change exact step to step in theapplication.

Redtea

Page27

CONFIDENTIAL3/15/2013

3.

Managementand Project Planning

3.1.

Management Approach

-

Our Group decided to use Scrum system to develop our software because of several advantages of this method. The firstadvantage is that it is simple and easy to follow. In campus, every member of our group meets the others almost every day, sowe can have a lot of scrum meeting and discussion about the problems and solutions of our system.

-

The second advantage is with scrum process, we can break the work down to many parts. Hence, we can balance the work ofeveryone, and our system was finished step by step.

3.2.

Sprint Retrospective Meeting

-

We have 1 meetings in class each week

-

Each meeting in class is a time boxed to 5 minutes

-

The scrum meeting in class is the placewhere each member showed the result of the work part then discusses what problemthey face and how to improve it.