Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dale Roberts Object Oriented Programming using Java - OOD to OOP: ATM Case Study Dale Roberts, Lecturer Computer Science, IUPUI

Similar presentations


Presentation on theme: "Dale Roberts Object Oriented Programming using Java - OOD to OOP: ATM Case Study Dale Roberts, Lecturer Computer Science, IUPUI"— Presentation transcript:

1 Dale Roberts Object Oriented Programming using Java - OOD to OOP: ATM Case Study Dale Roberts, Lecturer Computer Science, IUPUI E-mail: droberts@cs.iupui.edu Department of Computer and Information Science, School of Science, IUPUI

2 Dale Roberts 2 Starting to Program the Classes of the ATM System Visibility Attributes normally should be private, methods invoked by clients should be public Visibility markers in UML A plus sign (+) indicates public visibility A minus sign (-) indicates private visibility Navigability Navigability arrows indicate in which direction an association can be traversed Bidirectional navigability Associations with navigability arrows at both ends or no navigability arrows at all can be traversed in either direction

3 Dale Roberts 3 Fig. 8.24 | Class diagram with visibility markers.

4 Dale Roberts 4 Fig. 8.25 | Class diagram with navigability arrows.

5 Dale Roberts 5 Starting to Program the Classes of the ATM System (Cont.) Implementing the ATM system from its UML design (for each class) Declare a public class with the name in the first compartment and an empty no-argument constructor Declare instance variables based on attributes in the second compartment Declare references to other objects based on associations described in the class diagram Declare the shells of the methods based on the operations in the third compartment Use the return type void if no return type has been specified

6 Dale Roberts 6 Fig. 8.24 | Class diagram with visibility markers.

7 Dale Roberts 7Outline withdrawal.ja va Class for Withdrawal Empty no-argument constructor

8 Dale Roberts 8 Fig. 8.24 | Class diagram with visibility markers.

9 Dale Roberts 9Outline withdrawal.ja va Declare instance variables

10 Dale Roberts 10 Fig. 8.25 | Class diagram with navigability arrows.

11 Dale Roberts 11Outline withdrawal.ja va Declare references to other objects

12 Dale Roberts 12 Fig. 8.24 | Class diagram with visibility markers.

13 Dale Roberts 13Outline withdrawal.ja va Declare shell of a method with return type void

14 Dale Roberts Acknowledgements Deitel, Java How to Program


Download ppt "Dale Roberts Object Oriented Programming using Java - OOD to OOP: ATM Case Study Dale Roberts, Lecturer Computer Science, IUPUI"

Similar presentations


Ads by Google