An Example of Object-Oriented Design:
An ATM Simulation

This page is the starting point into a series of pages that attempt to give a complete example of object-oriented analysis, design, and programming applied to a moderate size problem: the simulation of an Automated Teller Machine. I developed these pages in the belief that students would benefit from seeing a complete example of OO methodology applied to a single problem.

Beginning with a statement of requirements, the process proceeds through identification of objects, use-case analysis (as in [Jacobson, 1992]), development of state and interaction diagrams, the beginning of the design process through the use of CRC cards, the development of a class diagram, and detailed class design using class and operation description forms. The resultant design is implemented using both C++ and Java (two separate implementations), with most of the code being accessible - though I have kept some hidden for reasons explained on the code page.

I developed this series of pages for use in my course "Object Oriented Software Development with C++", taught to junior CS majors at Gordon College. Insofar as possible, I have followed the design methodology taught in the textbook I am using for the course - [Horstmann, 1995]. However, since this book does not discuss object-oriented analysis I have had to bring in material from other sources. Probably the best way to start using these pages is to begin with the Requirements document and then continue through the steps in the process in the order listed below, until you get to the CRC cards. You will find that each CRC card has a link to the corresponding class description form, which in turn has links to the C++ and Java declarations for the class and the operation description forms for its methods. The operation description forms, in turn, have links to the C++ and Java implementations of each method. (In the case of C++, the declarations are contained in header (.h) files and the implementations in implementation (.cc) files; in the case of Java, the declaration and implementation of each method are the same. Otherwise, I have tried to make the two implementations as parallel in form as possible, to facilitate comparison between the two languages) These will allow you to follow through the complete design process for each individual class. Finally, the last page links to the executable form of the Java implementation, which you can run if you have a Java-enabled browser. Enjoy!

These pages were last revised in September of 1997, primarily to incorporate the Java implementation, but also to make some changes suggested by others over the course of the year. If you printed copies of these pages before then, you might want to access the revised versions. The old version is also available if you wish to see it.

Though the pages are copyrighted, I hereby freely give permission for their reproduction for non commercial educational purposes. I hope they will prove useful to other faculty who are starting - as I am - to teach OO methods. I would also really welcome suggestions and feedback - either about the design itself or the way it is presented.

Russell C. Bjork
Professor of Computer Science
Gordon College
255 Grapevine Road
Wenham, MA 01984
(508) 927-2300 x 4377

[ Intro ] [ Requirements ] [ Domain Objects ] [ Use Cases ] [ State Diagram ] [ Interaction Diagram ]
[ CRC Cards ] [ Class Diagram ] [ Class Desc. Forms ] [ Operation Desc. Forms ] [ Code ] [ Executable ]

Copyright © 1996, 1997, 1998 - Russell C. Bjork. Permission for non-commercial reproduction for educational use is hereby granted; all other rights are reserved.