1 / 14

Object Oriented Programming using Java - OOD to OOP: ATM Case Study

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

Download Presentation

Object Oriented Programming using Java - OOD to OOP: ATM Case Study

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  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. Fig. 8.24 | Class diagram with visibility markers.

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

  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. Fig. 8.24 | Class diagram with visibility markers.

  7. Outline Class for Withdrawal withdrawal.java Empty no-argument constructor

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

  9. Outline withdrawal.java Declare instance variables

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

  11. Outline withdrawal.java Declare references to other objects

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

  13. Outline withdrawal.java Declare shell of a method with return type void

  14. Acknowledgements • Deitel, Java How to Program

More Related