Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. Introduction .......................................................................................................................................... 2 1.1 1.2 1.3 Object oriented programming ...................................................................................................... 2 Overview ....................................................................................................................................... 2 Case study ..................................................................................................................................... 3
1.4 Objective ............................................................................................................................................. 5 1.5 Assumption ......................................................................................................................................... 5 2. UML diagrams ....................................................................................................................................... 7 2.1 2.2 What is UML .................................................................................................................................. 7 Use case diagram .......................................................................................................................... 7
2.2.1 Case Study use Case Diagram ...................................................................................................... 9 2.2.2 2.3 Case Study class Diagram .................................................................................................... 10
2.3.1 2.4
2.4.1 3.
Design patterns ................................................................................................................................... 19 3.1 3.2 3.3 Abstract factory........................................................................................................................... 19 Proxy ........................................................................................................................................... 23 Prototype pattern ....................................................................................................................... 24
.................................................................................................................................................................... 25 4. 5. Application screen shots ..................................................................................................................... 26 Object oriented terminology explanation .......................................................................................... 34 5.1 5.2 5.3 5.4 Inheritance .................................................................................................................................. 34 Add new Customer ..................................................................................................................... 35 Encapsulation .............................................................................................................................. 37 Deposit ........................................................................................................................................ 38
1.2 Overview
Simple, non-OOP programs may be one long list of commands. More complex programs will group lists of commands into functions or subroutines each of which might perform a particular task. With designs of this sort, it is common for the program's data to be accessible from any part of the program. As programs grow in size, allowing any function to modify any piece of data means that bugs can have wide-reaching effects. In contrast, the object-oriented approach encourages the programmer to place data where it is not directly accessible by the rest of the program. Instead the data is accessed by calling specially written functions, commonly called methods, which are either bundled in with the data or inherited from "class objects" and act as the intermediaries for retrieving or modifying those data. The programming construct that combines data with a set of methods for accessing and managing those data is called an object. An object-oriented program will usually contain different types of objects, each type corresponding to a particular kind of complex data to be managed or perhaps to a real-world object or concept such as a bank account, a hockey player, or a bulldozer. A program might well contain multiple copies of each type of object, one for each of the real-world objects the program is dealing with. For instance, there could be one bank account object for each realworld account at a particular bank. Each copy of the bank account object would be alike in the methods it offers for manipulating or reading its data, but the data inside each object would differ reflecting the different history of each account. Mohammad Rafati Page 2
1.4 Objective
Provide an automatic system in order to control the operation o bank ATM system Implement a system for bank staff in order to control the operation o their ATM system Making all the bank activities easy for client of the bank or cardholders of the bank Provide a efficient way of transferring the money between a number o account link to one card
1.5 Assumption
The system works normally with all the requirement of the system. System operator with 3 kinds of actors with different responsibility Customer o o o Deposit Withdraw Balance inquiry Page 5
Mohammad Rafati
Operator Add new client Add new account for existing customer View transaction log Confirm deposit inside the system
Manager o o All the operator activity Add new operator to the system
The system has to be able to defines unlimited customer and unlimited number of account for the customer ,each account treats as an separate entity and has the ability of performing balance inquiry and all the bank activates When the user tries to log in, he/she can choose the prefer language at first. But all the language chosen in this system would be English. MOHAMMAD RAFATI
Mohammad Rafati
Page 6
2. UML diagrams
2.1 What is UML
The Unified Modeling Language (UML) is used to specify, visualize, modify, construct and document the artifacts of an software-intensive system under development UML offers a standard way to visualize a system's architectural blueprints, The Unified Modeling Language (UML) was adopted by the Object Management Group (OMG) in 2000 and is now the modeling language of choice for modeling application structure, behavior, architecture and data and, increasingly, business processes. Along with it is a key foundation of the modeling
Figure 1: UML
Mohammad Rafati
Page 7
Mohammad Rafati
Page 8
2.2.1.1Use Case Textual Description Preconditions: The ATM cash box is well stocked. There is no card in the reader. Main success scenario:
Mohammad Rafati
Page 9
A use case represents the specification of a sequence of actions, including variants that a system can perform, interacting with actors of the system. For each actor identified previously, it is advisable to search for the different business goals, according to which is using the system. Contrary to what we might believe, all actors do not necessarily use the system. We call the one for whom the use case produces an observable result the primary actor. In contrast, secondary actors constitute the other participants of the use case. A use case diagram shows the relationships among actors and the subject (system), and use cases. We draw use cases (ellipses) inside the ATM system (box) and linked by associations
2.2.2 Case Study class Diagram The class diagram has always been the most important diagram in all object oriented methods. This is the diagram that automatic code generation tools use first and foremost. Page 10
Mohammad Rafati
Mohammad Rafati
Page 11
Mohammad Rafati
Page 12
modeling, which focuses on identifying the behavior within your system. Sequence diagrams are typically used to model: Usage scenarios: A usage scenario is a description of a potential way in a system. The logic of a usage scenario may be part of a use case, perhaps an alternate course. It may also be one entire pass through a use case, such as the logic described by the basic course of action or a portion of the basic course of action, plus one or more alternate scenarios. The logic of a usage scenario may also be a pass through the logic contained in several use cases. For example, a student enrolls in the university, and then immediately enrolls in three seminars. The logic of methods: Sequence diagrams can be used to explore the logic of a
complex operation, function, or procedure. One way to think of sequence diagrams, particularly highly detailed diagrams, is as visual object code. The logic of services. A service is effectively a high-level method, often one that can be invoked by a wide variety of clients. This includes web-services as well as business transactions implemented by a variety of technologies such as CICS/COBOL or CORBA-compliant object request brokers (ORBs).
Mohammad Rafati
Page 13
2.3.1.2 Withdraw
Mohammad Rafati
Page 14
Mohammad Rafati
Page 15
Mohammad Rafati
Page 16
2.4.1.3 Withdraw
Mohammad Rafati
Page 17
Mohammad Rafati
Page 18
Mohammad Rafati
Page 19
Below is some samples created from abstract class without specifying their classes.
Mohammad Rafati
Page 20
Mohammad Rafati
Page 21
Mohammad Rafati
Page 22
Mohammad Rafati
Page 23
Mohammad Rafati
Page 24
Mohammad Rafati
Page 25
Main frame This frame can be used for the cardholders of the ATM to login into their Services Frame, Also there is a button for Staff of the system in order to login to perform different task.
Mohammad Rafati
Page 26
The Above Picture demonstrace the Staff Login frame for ATM operator
Mohammad Rafati
Page 27
Mohammad Rafati
Page 28
In the Operator Interface ,validation also Provided for Adding New Customer ,Addign new staff and etc .
Mohammad Rafati
Page 29
Services Frame The Card Holders of ATM after login use the Services frame in order to perform different Functionalities, the services available In the Services Frame include Withdraw Money From Different Accounts Deposit Money Into different Accounts Consult the Balance of Different Accounts Transfer the Money between Card holder Different Accounts Transfer the Money to Third party Person account Number
Mohammad Rafati
Page 30
Mohammad Rafati
Page 31
Transfer money Section This section of program is used for transferring the Money between Customers Accounts
Mohammad Rafati
Page 32
Mohammad Rafati
Page 33
Mohammad Rafati
Page 34
Above figure in the add customer section check for the validity of input data such as empty fields and the correct type of input
Mohammad Rafati
Page 35
Above figure demonstrate that all the customer object field are initialized and the new customer will be added to the bank database after confirmation
Mohammad Rafati
Page 36
Mohammad Rafati
Page 37
Above figure demonstrate that deposit transaction has been performed by the customer and after checking with banks server it goes for final confirmation by officer and one log of this transaction is added to the bank transaction collection for the usage of transaction log
Mohammad Rafati
Page 38
Mohammad Rafati
Page 39
References
[Online] java how to program
Java how to program ,second edition ,DEITEL and DEITEL ,2004 , DEITEL publisher
Mohammad Rafati
Page 40