atmcasestudy
DESCRIPTION
ATM case study UMLTRANSCRIPT
-
7/18/2019 ATMCaseStudy
1/14
Dale Roberts
Object Oriented Programming using JavaObject Oriented Programming using Java
- OOD to OOP: ATM Case Study- OOD to OOP: ATM Case Study
Dale Roberts, Lecturer
Computer Science, IUPUI
E-mail: [email protected]
Department of Computer and Information Science,
School of Science, IUPUI
-
7/18/2019 ATMCaseStudy
2/14
Dale Roberts
Starting to Program the Classes of the ATM SystemStarting to Program the Classes of the ATM System
VisibilityVisibility
Attributes normally should be private, methodsAttributes normally should be private, methodsinvoked by clients should be publicinvoked by clients should be public
Visibility markers in UMLVisibility markers in UML
A plus sign (+) indicates public visibilityA plus sign (+) indicates public visibility
A minus sign (-) indicates private visibilityA minus sign (-) indicates private visibility
NavigabilityNavigability
avigability arro!s indicate in !hich direction anavigability arro!s indicate in !hich direction an
association can be traversedassociation can be traversed
"idirectional navigability"idirectional navigability
Associations !ith navigability arro!s at both ends or noAssociations !ith navigability arro!s at both ends or no
navigability arro!s at all can be traversed in either directionnavigability arro!s at all can be traversed in either direction
-
7/18/2019 ATMCaseStudy
3/14
Dale Roberts!
ig! "!#$ig! "!#$ % Class diagram &ith visibility mar'ers!% Class diagram &ith visibility mar'ers!
-
7/18/2019 ATMCaseStudy
4/14
Dale Roberts"
ig! "!#(ig! "!#( % Class diagram &ith navigability arro&s!% Class diagram &ith navigability arro&s!
-
7/18/2019 ATMCaseStudy
5/14
Dale Roberts#
Starting to Program the Classes of the ATM System )Cont!*Starting to Program the Classes of the ATM System )Cont!*
+m,lementing the ATM system from its -M.+m,lementing the ATM system from its -M.
design )for each class*design )for each class*#eclare a#eclare a publicpublicclass !ith the name in the $irstclass !ith the name in the $irst
compartment and an empty no-argument constructorcompartment and an empty no-argument constructor
#eclare instance variables based on attributes in the#eclare instance variables based on attributes in the
second compartmentsecond compartment
#eclare re$erences to other ob%ects based on#eclare re$erences to other ob%ects based on
associations described in the class diagramassociations described in the class diagram
#eclare the shells o$ the methods based on the#eclare the shells o$ the methods based on the
operations in the third compartmentoperations in the third compartmentUse the return typeUse the return type voidvoidi$ no return type has been speci$iedi$ no return type has been speci$ied
-
7/18/2019 ATMCaseStudy
6/14
Dale Roberts$
ig! "!#$ig! "!#$ % Class diagram &ith visibility mar'ers!% Class diagram &ith visibility mar'ers!
-
7/18/2019 ATMCaseStudy
7/14Dale Roberts
%OutlineOutline
withdrawal.ja
va
Class for
Withdrawal
Empt& no-ar'ument
constructor
-
7/18/2019 ATMCaseStudy
8/14Dale Roberts(
ig! "!#$ig! "!#$ % Class diagram &ith visibility mar'ers!% Class diagram &ith visibility mar'ers!
-
7/18/2019 ATMCaseStudy
9/14Dale Roberts
)OutlineOutline
withdrawal.ja
va
Declare instance
*ariables
-
7/18/2019 ATMCaseStudy
10/14Dale Roberts+
ig! "!#(ig! "!#( % Class diagram &ith navigability arro&s!% Class diagram &ith navigability arro&s!
-
7/18/2019 ATMCaseStudy
11/14Dale Roberts
++OutlineOutline
withdrawal.ja
va
Declare references to other
obects
-
7/18/2019 ATMCaseStudy
12/14Dale Roberts+
ig! "!#$ig! "!#$ % Class diagram &ith visibility mar'ers!% Class diagram &ith visibility mar'ers!
O li
-
7/18/2019 ATMCaseStudy
13/14Dale Roberts
+!OutlineOutline
withdrawal.ja
va
Declare shell of a method ith
return t&pe *oid
-
7/18/2019 ATMCaseStudy
14/14Dale Roberts
Ac'no&ledgementsAc'no&ledgements
Deitel, Java How to Program