ATM OO Design and Implementation Case Study

Slides:



Advertisements
Similar presentations
Chapter 4: Requirements Engineering
Advertisements

Design by Contract.
Use Case Diagrams Damian Gordon.
Use Case & Use Case Diagram
1 Object-oriented design Part 2: OO tools & UML. 2 CRC cards Design tool & method for discovering classes, responsibilities, & relationships Record on.
Chapter 25 ATM Case Study, Part 1: Object-Oriented Design with the UML
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
Use Case Modeling SJTU. Unified Modeling Language (UML) l Standardized notation for object-oriented development l Needs to be used with an analysis and.
UML and Systems Analysis MIS3502: Application Integration and Evaluation David Schuff
Ch 12: Object-Oriented Analysis
Introduction to Software Testing Chapter 2.6 Graph Coverage for Use Cases Paul Ammann & Jeff Offutt
Sequence Diagrams. Introduction A Sequence diagram depicts the sequence of actions that occur in a system. The invocation of methods in each object, and.
CS3773 Software Engineering Lecture 03 UML Use Cases.
Paul Deitel, CEO Deitel & Associates, Inc.. Contact Information  Paul Deitel, CEO  Deitel & Associates, Inc.  Twitter:  Facebook:
Software Modeling Jerry Lebowitz.
1 Classes. 2 Finding classes w Choosing classes is first step in defining essence of problem w If you can recognize an abstraction, you’ve found a candidate.
Chapter 12 ATM Case Study, Part 1: Object-Oriented Design with the UML
ATM User Interface Design. Requirements A bank customer is able to access his or her account using an automatic teller machine. To be able to use an ATM.
Interaction Diagrams Activity Diagram State Machine Diagram
(C) 2010 Pearson Education, Inc. All rights reserved. Java How to Program, 8/e.
Use Case Modeling. Use case diagram For each use case we develop  Object class diagram (with attributes only)  System sequence diagram (analysis) 
The chapter will address the following questions:
From Problem Statement to Design
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 3: Requirements Specification, C++ Basics.
Big Java Chapter 12. Software Process - Waterfall Analysis Design Implementation Testing Deployment Does not work well when rigidly applied! established.
(C) 2010 Pearson Education, Inc. All rights reserved. Java How to Program, 8/e.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
1 Object-Oriented Analysis Use Case Driven. 2 The outline method for OOA 1.Identify object classes within the problem domain 2.Define the behaviour of.
Faculty of Computer & Information Software Engineering Third year
1 Introduction to Classes and Objects Chapter 3 Introduction to Classes and Objects Chapter 3.
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Unit 2 – Algorithms & Pseudocode. Algorithms Computer problems solved by executing series of action in order Procedure –The Actions to execute –The Order.
January Ron McFadyen1 January 2004 Assignment 1 Due: Friday Jan 23, Implement the ProductSpecification and Payment classes in any OO.
1 Graph Coverage (6). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
Chapter 13 ATM Case Study Part 2: Implementing an Object-Oriented Design Java How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved.
Java How to Program, 9/e © by Pearson Education, Inc. All Rights Reserved.
Chapter 3: Software Design –Use case Diagram Nouf Alghanmi.
CHAPTER 6 OBJECT ANALYSIS.
1 Object-Oriented Static Modeling of the Banking System - III Lecture # 33.
Inf 43: Introduction to Software Engineering May 7, 2016.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Spring 2013 Lecture 2: Software Design Cycle, Requirements Specification and.
Using Use Case Diagrams
Object-oriented and Structured System Models
Paul Ammann & Jeff Offutt
CMPE 280 Web UI Design and Development August 29 Class Meeting
Use Case Modeling - II Lecture # 27.
Unified Modeling Language (UML)
Object-Oriented Analysis and Design
Storyboarding and Game Design SBG, MBG620 Full Sail University
Dynamic Modeling of Banking System Case Study - I
Use Case Model.
Object-Oriented Static Modeling of the Banking System - I
Dynamic Modeling of Banking System Case Study - II
UML Use Case Diagrams.
OO Domain Modeling With UML Class Diagrams and CRC Cards
How An ATM Work's Prepaid by, kakani Dinesh.
Chapter 12 ATM Case Study, Part 1: Object-Oriented Design with the UML
Software Production Case Study ATM.
Chapter 13 ATM Case Study Part 2: Implementing an Object-Oriented Design Java How to Program, 8/e (C) 2010 Pearson Education, Inc. All rights reserved.
Concepts, Specifications, and Diagrams
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Paul Ammann & Jeff Offutt
Week 12: Activity & Sequence Diagrams
Chapter 20 Object-Oriented Analysis and Design
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Software Design Lecture : 15.
Using Use Case Diagrams
Seminar 2 Design of Informatics Systems
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Presentation transcript:

ATM OO Design and Implementation Case Study Chapter 12 & 13 of Java How to Program, 9/e 5/20/2018

ATM Case Study Popular example—people can relate to it Available in 4 languages Java, C++, Visual Basic and Visual C# “How to Program” books 5/20/2018

Case Study Coverage Starts with System Requirements Presents 6 UML diagram types Use case, class, state machine, activity, communication, sequence Simplified design process Requirements document 5/20/2018

Design Process Examine the Requirements Document Identify the Classes Identify Class Attributes Identify Objects’ States and Activities Identify Class Operations Indicate Collaboration Among Objects Start to Program the Classes Incorporate Inheritance and Polymorphism into the design 5/20/2018

Examining the Requirements A local bank intends to install a new ATM to allow bank customers to perform basic financial transactions Each customer can have only one account at the bank. ATM bank customers view their account balance withdraw cash deposit funds ATM user interface: a screen that displays messages to the user a keypad that receives numeric input from the user a cash dispenser that dispenses cash to the user and a deposit slot that receives deposit envelopes from the user. The cash dispenser begins each day loaded with 500 $20 bills. 5/20/2018

5/20/2018

Simplifying Assumptions: the bank plans to build only one ATM Each user has only one account Use the computer’s monitor to simulate the ATM’s screen Use the computer’s keyboard to simulate the ATM’s keypad the bank does not make any changes to the information in the database while a user is accessing the ATM. the bank trusts the ATM to access and manipulate the information in the database without significant security measures. 5/20/2018

Upon first approaching the ATM, the user should experience the following sequence of events: The screen displays Welcome! and prompts the user to enter an account number. The user enters a five-digit account number using the keypad. The screen prompts the user to enter the PIN. The user enters a five-digit PIN using the keypad. If the user enters a valid account number and the correct PIN for that account, the screen displays the main menu. If the user enters an invalid account number or an incorrect PIN, the screen displays an appropriate message, then the ATM returns to Step 1 to restart the authentication process. 5/20/2018

5/20/2018

The ATM must retrieve the balance from the bank’s database. If the user enters 1 to make a balance inquiry, the screen displays the user’s account balance. The ATM must retrieve the balance from the bank’s database. 5/20/2018

When a user selects 2 for withdrawal, ... 5/20/2018

The user enters a menu selection using the keypad. If the withdrawal amount is greater than the user’s account balance, … If the withdrawal amount is less than or equal to the user’s account balance ... If the user chooses to cancel, ... If the cash dispenser contains enough cash, ... Otherwise ... The ATM debits the withdrawal amount from the user’s account in the bank’s database. The cash dispenser dispenses the desired amount of money. The screen displays a message reminding the user to take the money. 5/20/2018

When the user enters 3 to make a deposit: The screen prompts the user to enter a deposit amount or type 0 (zero) to cancel. The user enters a deposit amount or 0 using the keypad. If the user specifies a deposit amount, the ATM proceeds ... If the user chooses to cancel, the ATM ... The screen displays a message telling the user to insert a deposit envelope. If the deposit slot receives a deposit envelope within two minutes, the ATM credits the deposit amount to the user’s account in the bank’s database. 5/20/2018

Analyzing the ATM system Interactions between a system and its external entities (actors) 5/20/2018

Design the ATM systems The output of the design stage—a design specification—should specify clearly how the system should be constructed to satisfy these requirements. During the analysis stage, systems designers focus on understanding the requirements document to produce a high-level specification that describes what the system is supposed to do. When designing any system, one must solve the problem right, but of equal importance, one must solve the right problem. 5/20/2018

Identifying the Classes in a Requirements Analyze the nouns and noun phrases Create classes only for the nouns and noun phrases that have significance in the ATM system. Some of these nouns and noun phrases are actually attributes Some of the nouns do not correspond to parts of the system Additional classes may become apparent to us as we proceed through the design process. 5/20/2018

Classes: ATM screen keypad cash dispenser deposit slot account bank database balance inquiry withdrawal deposit 5/20/2018

Diagrams Class diagrams Model classes used in a system. Specify structural relationships between system parts The solid line that connects the two classes represents an association—a relationship between classes. The numbers near each end of the line are multiplicity values, which indicate how many objects of each class participate in the association. At any given moment, one ATM object participates in an association with either zero or one Withdrawal objects—zero if the current user is not currently performing a transaction or has requested a different type of transaction, and one if the user has requested a withdrawal. An association can be named. The word Executes above the line connecting classes ATM and Withdrawal in Fig. 12.7 indicates the name of that association. This part of the diagram reads “one object of class ATM executes zero or one objects of class Withdrawal.” Association names are directional, as indicated by the filled arrowhead. 5/20/2018

In Fig. 12.9, the solid diamonds attached to the ATM class’s association lines indicate that ATM has a composition relationship with classes Screen, Keypad, CashDispenser and DepositSlot. Composition implies a whole/part relationship. The class that has the composition symbol (the solid diamond) on its end of the association line is the whole (in this case, ATM), and the classes on the other end of the association lines are the parts. has-a relationship. 5/20/2018

5/20/2018

5/20/2018

Identifying Class Attributes Classes have attributes (data) and operations (behaviors). Look for descriptive words and phrases in the requirements document. For each such word and phrase we find that plays a significant role in the ATM system, we create an attribute and assign it to one or more of the classes 5/20/2018

5/20/2018

5/20/2018

5/20/2018

Identifying Objects’ States and Activities After adding attributes to classes, a state diagram can be used to show how those attributes represent an object’s state and how the state of an object changes. An activity diagram can be used to model the actions (sequence of events) the object will perform and in what order. 5/20/2018

Diagrams State machine diagrams Model how an object changes state Indicated by the values of object attributes at a given time 5/20/2018

5/20/2018

Diagrams Activity diagrams Model workflow during program execution Model actions and order in which they’re performed 5/20/2018

5/20/2018

5/20/2018

5/20/2018

Identifying Class Operations An operation is a service that objects of a class provide to clients (users) of the class. We can derive many of the class operations by examining the key verbs and verb phrases in the requirements document. 5/20/2018

5/20/2018

5/20/2018

5/20/2018

5/20/2018

Identifying Collaborations in a system We identify the collaborations by reading the sections of the requirement document that specify what the ATM should do to perform each operation. For each action, we decide which objects must be involved. For objects involved, we identify the sending/receiving objects. Then we identify the operation of the receiving object invoked by the sending object. 5/20/2018

5/20/2018

5/20/2018

Diagrams Communication diagrams Sequence diagrams Model interactions among objects Emphasis on what interactions occur. Sequence diagrams Emphasis on when interactions occur 5/20/2018

5/20/2018

5/20/2018

5/20/2018

Convert class diagrams to Java code. Tune the design with inheritance and polymorphism. 5/20/2018

Incorporating Inheritance and Polymorphism To apply inheritance, look for commonality among classes in the system. Create an inheritance hierarchy to model similar (yet not identical) classes in a more elegant and efficient manner. Modify class diagram to incorporate the new inheritance relationships. Polymorphism provides the ATM with an elegant way to execute all transactions “in the general.” The polymorphic approach also makes the system easily extensible. To create a new transaction type, just create an additional Transaction subclass that overrides the execute method with a version of the method appropriate for executing the new transaction type. 5/20/2018

5/20/2018

5/20/2018

5/20/2018

5/20/2018