 2008 Pearson Education, Inc. All rights reserved. 1 9.11 (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System.

Slides:



Advertisements
Similar presentations
 Pearson Education, Inc. All rights reserved static Class Members static fields – Also known as class variables – Represents class-wide.
Advertisements

 2009 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Classes: A Deeper Look, Part 1.
 2006 Pearson Education, Inc. All rights reserved Midterm review Introduction to Classes and Objects.
Specification and Implementation Separating the specification from implementation makes it easier to modify programs. Changes in the class’s implementation.
 2006 Pearson Education, Inc. All rights reserved Midterm review Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Classes: A Deeper Look, Part 1.
 2008 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2008 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2005 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2008 Pearson Education, Inc. All rights reserved (Optional) Software Engineering Case Study: Incorporating Inheritance into the ATM System UML.
 2008 Pearson Education, Inc. All rights reserved (Optional) Software Engineering Case Study: Identifying the Classes in the ATM Requirements.
 2009 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Reformatted slides from the textbook, C++ How to Program, 6/e Pearson Education, Inc. All rights reserved Chapter 3. [Lecture 01] Introduction to.
You gotta be cool. Access Functions and Utility Functions Preprocessor Wrapper Looking Ahead to Composition and Inheritance Object Size Class Scope and.
 2006 Pearson Education, Inc. All rights reserved Classes: A Deeper Look, Part 1.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 3: Requirements Specification, C++ Basics.
(C) 2010 Pearson Education, Inc. All rights reserved. Java How to Program, 8/e.
More C++ Classes Systems Programming. C++ Classes  Preprocessor Wrapper  Time Class Case Study –Two versions (old and new)  Class Scope and Assessing.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13: Introduction to Classes.
1 Introduction to Classes and Objects Chapter 3 Introduction to Classes and Objects Chapter 3.
Dale Roberts Object Oriented Programming using Java - OOD to OOP: ATM Case Study Dale Roberts, Lecturer Computer Science, IUPUI
Reformatted slides from the textbook, C++ How to Program, 6/e Pearson Education, Inc. All rights reserved Chapter 3. [Lecture 02] Introduction to.
Java™ How to Program, 10/e © Copyright by Pearson Education, Inc. All Rights Reserved.
CLASSES : A DEEPER LOOK Chapter 9 Part I 1. 2 OBJECTIVES In this chapter you will learn: How to use a preprocessor wrapper to prevent multiple definition.
 2006 Pearson Education, Inc. All rights reserved Classes and Objects: A Deeper Look.
 2006 Pearson Education, Inc. All rights reserved Polymorphism, Interfaces & Operator Overloading.
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.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2008 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2008 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Classes: A Deeper Look, Part 1.
 2008 Pearson Education, Inc. All rights reserved Classes: A Deeper Look, Part 1.
 2008 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2006 Pearson Education, Inc. All rights reserved Classes: A Deeper Look, Part 1.
 2005 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2005 Pearson Education, Inc. All rights reserved. 1 Classes and Objects: A Deeper Look.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 13: Introduction to Classes.
Classes Classes are a major feature of C++. They support – – Abstraction – Data hiding – Encapsulation – Modularity – Re-use through inheritance.
C++ How to Program, 8/e © by Pearson Education, Inc. All Rights Reserved.
CLASSES AND OBJECTS Chapter 3 : constructor, Separate files, validating data.
 2005 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 6 Outline 6.1 Introduction 6.2 Implementation: Visibility 6.3 Implementation:
C++ How to Program, 7/e.  There are cases in which it’s useful to define classes from which you never intend to instantiate any objects.  Such classes.
 2007 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Introduction to Classes and Objects
Classes and Objects: A Deeper Look
Unified Modeling Language (UML)
Introduction to Classes and Objects
Introduction to Classes and Objects
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.
Chapter 3 Introduction to Classes, Objects Methods and Strings
Chapter 3 Introduction to Classes, Objects Methods and Strings
Chapter 9 Classes: A Deeper Look, Part 1
Slides by Steve Armstrong LeTourneau University Longview, TX
Introduction to Classes and Objects
Classes: A Deeper Look, Part 1
Introduction to Classes and Objects
Classes: A Deeper Look, Part 1
Introduction to Classes and Objects
Presentation transcript:

 2008 Pearson Education, Inc. All rights reserved (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System Visibility of an object’s attributes and operations – Determined by access specifiers – Data members normally have private visibility – Member functions normally have public visibility – Utility functions normally have private visibility UML Visibility Markers – Placed before an operation or an attribute – Plus sign ( + ) indicates public visibility – Minus sign ( – ) indicates private visibility

 2008 Pearson Education, Inc. All rights reserved. 2 Fig | Class diagram with visibility markers.

 2008 Pearson Education, Inc. All rights reserved. 3 Fig | Class diagram with navigability arrows.

 2008 Pearson Education, Inc. All rights reserved (Optional) Software Engineering Case Study: Starting to Program the Classes of the ATM System (Cont.) Implementing a class from its UML design – Use the name located in the first compartment of a class diagram to define the class in a header file – Use the attributes located in the class’s second compartment to declare the data members – Use the associations described in the class diagram to declare references (or pointers, where appropriate) to other objects Use forward declarations for references to classes (where possible) instead of including full header files – Helps avoid circular includes Preprocessor problem that occurs when header file for class A #include s header file for class B and vice versa – Use the operations located in the class’s third compartment to write the function prototypes of the class’s member functions

 2008 Pearson Education, Inc. All rights reserved. 5 Outline fig09_22.cpp (1 of 1) #ifndef, #define and #endif preprocessor directives help prevent multiple-definition errors Class name is based on the top compartment of the class diagram

 2008 Pearson Education, Inc. All rights reserved. 6 Outline Withdrawal.h (1 of 1) Data members are based on the attributes in the middle compartment of the class diagram

 2008 Pearson Education, Inc. All rights reserved. 7 Outline Withdrawal.h (1 of 1) References are based on the associations in the class diagram #include preprocessor directives for classes of associated objects

 2008 Pearson Education, Inc. All rights reserved. 8 Outline Withdrawal.h (1 of 1) Forward declarations of classes for which this class has references

 2008 Pearson Education, Inc. All rights reserved. 9 Outline Withdrawal.h (1 of 1) Member functions are based on operations in the bottom compartment of the class diagram

 2008 Pearson Education, Inc. All rights reserved. 10 Outline Account.h (1 of 1)