Introduction to Object-Oriented Programming in C++
"The instructor was very 'enjoyable' and
interesting,
witty, etc., and volunteered lots of real life examples. This
instructor
really does it and the difference is apparent."
- New C++ Programmer
Description
This version of Introduction to
Object-Oriented Programming in C++
is the result of many years of experience with teaching these
topics
in industry and academic environments, and of tracking the effect of
the
training as students move into production C++ development. As a result,
the course covers those aspects of C++ and object-oriented design
required
for a new C++ programmer to become an effective member of a project
team
in minimum time, while providing a base for more advanced instruction
in
C++ language features and programming and design techniques.
The course has been completely revamped to introduce students to the
most cutting edge concepts in current production C++ programming,
including RAII, smart pointer, and function object idioms, the standard
template library, the TR1 standard library extensions, design patterns,
and exception handling.
The course covers C++
language features in the context of both object-oriented
and generic programming, so that the student learns not only the C++
language syntax,
but how to apply C++ effectively in data abstraction,
object-oriented, and generic
design. Language features, essential programming techniques, and design
guidelines are presented as a unified whole.
The text contains extensive
notes sections that elaborate and expand
on the course material, and allow the text to be used as a reference.
Of
particular utility are numerous "gotcha" notes, set off by a special
symbol,
that show how to avoid subtle language and design errors. The
course
includes laboratory exercises and solutions.
Audience
This course is designed
to serve the needs of experienced programmers
with
little or no previous exposure to C++. For programmers with no
experience
with C, C++ Jumpstart for Non-C Programmers
provides coverage of the topics required to proceed with the body of
the
course.
Format
5 days, lecture/lab
Outline
- Preliminaries
- C++ as a “better” C
- // comments
- bool
- const and volatile
- References and argument passing
- Default arguments, function overloading, and inline functions
- Changes to statements
- new and delete operators
- New-style cast operators
- Runtime static initialization
- Namespaces and standard header files
- The iostream library
- std::string
- Classes and Data Abstraction
- Data Abstraction
- Classes and Class Members
- Public and Private Class Members
- Member Function Definitions, Class Scope, and this
- Constructors and Destructors
- RAII
- Const Member Functions and Member Initialization Lists
- Copy Operations and Operator Overloading
- Assignment and initialization
- Copy operations
- Operator overloading
- Friends
- Extending iostream
- User-defined conversions
- Static class members
- Object Composition
- Review of data abstraction
- Layering objects
- Initialization and cleanup of composed objects
- Composition and copying
- Smart pointers and RAII
- Indirect composition and smart pointers
- Has-a relationships and associations
- Templates
- Motivation for templates
- Class templates
- Function templates
- Argument deduction and function template overloading
- Template specialization and instantiation
- Containers and generic algorithms
- Inheritance and Dynamic Binding
- Base and derived classes
- The is-a relationship and conversions
- Class hierarchies
- Dynamic binding and virtual functions
- Polymorphic base classes
- Protected class members
- Pure virtual functions and abstract base classes
- Proper design with inheritance
- Introduction to the STL
- Purpose and Structure of the STL
- Containers, Iterators, and Algorithms
- STL Containers
- Operations on STL Containers
- STL Iterators
- Iostream Iterators
- Inserters
- STL Generic Algorithms
- Some generic algorithms
- Functions and generic algorithms
- Function pointers and function objects
- Function objects and generic algorithms
- Standard function objects and adapters
- Advanced Topics
- Design Patterns
- Exceptions
- Runtime type information
- OOA/D/P and the OO Development Process