Course Overview

The course starts with a critique of a moderate-sized C program, and then introduces C++ features to correct the flaws in that program. As the program evolves toward an object-oriented design, the course introduces more C++ features to improve the clarity of the design and the efficiency of the resulting code. Thus, rather than present language features out of context, this course presents each major C++ feature as the solution to a real-world programming problem. In order to give the students a more realistic setting for using the language, the course concentrates on a handful of larger examples and exercises, instead of a smattering of small, isolated examples. Along the way, all the key syntactic features of C++ are introduced and explained in detail.

This seminar does not cover certain advanced language features, such as the STL, advanced file I/O, or GUI programming. While this C++ training stresses the object oriented features in C++, it is not a course in object-oriented design or analysis.

Key Learning Areas

  • Become familiar with the core syntax of the language.
  • Learn how object oriented practices can improve modularity, extensibility, and robustness.
  • Explore, in depth, the reasoning behind C++'s object oriented features.
  • Learn to apply C++'s OOP features.
  • Get hands-on experience applying OOP techniques to realistic programming examples.

Course Outline

  • Introduction
    • Fundamental Design Concepts
    • Abstract Data Types
    • The "Spirit" of C++
  • Translating Object-Oriented Concepts into Practice
    • Compiling and Running C++ programs
    • "Programming in the Large"
    • Case study: Critiquing a "Large" C program
    • Encapsulation using Separate Compilation
  • Classes and Objects
    • Member Functions
    • Declaring and Using Objects
    • Partitioning Design Decisions
    • C++ Notation and Terminology
    • Access Control
  • Storage Allocation
    • Static, Automatic and Dynamic Memory
    • new and delete operators
    • Case study: Dynamic Arrays
    • Constructors and Destructors
    • Member Initializers
    • Static Data and Function Members
  • Building More Powerful Abstractions
    • Inline Functions
    • Function Name Overloading
    • const and volatile Qualifiers
    • const Member Functions
    • References as Arguments and Return Types
    • Copy Constructors
  • Language Extensibility
    • Operator Overloading
    • Case Study: Rational Numbers
    • Default Assignment Operator
    • Default Function Arguments
    • Friend Functions
    • Stream Input and Output
    • Conversion Operators
  • Inheritance
    • Reusing Classes via Membership (Aggregation or Composition)
    • Reusing Classes via Inheritance (Derivation)
    • Inheritance vs. Aggregation (Is-A vs. Has-A Relationships)
  • Scope and Access Control
    • Scope Rules
    • Nested Classes
    • Friend Classes
    • More on Access Control
  • Object-Oriented Programming Techniques
    • Static vs. Dynamic Binding
    • Polymorphism
    • Case Study: a Unix-like File System
    • Type Fields and Discriminated Unions
    • Common Interfaces Using Inheritance
    • Virtual Functions
    • Abstract Base Classes and Pure Virtual Functions
    • Pointer and Reference Conversions
    • Case Study: a Hierarchy of Geometric Shapes

Who Benefits

Experienced software developers who want to "move up" to C++ and object oriented programming.

Project managers who need to understand how C++ and object oriented programming differ from traditional C programming.

Prerequisites

Participants need not have any prior C++ experience, but should be experienced with C. (A reading knowledge is rarely sufficient.) In particular, qualified participants should be able to:

  • Read and write data declarations and function prototype declarations
  • Understand the interchangeability of pointer and subscripting notation
  • Work with structs and pointers to structs
  • Build programs from more than one source (.c) file