Week 8

Home Windows C++ 241 C++ 242 Contact Info Contents

Week 8 - February 26

Back Up Next

Due Today

Chapter 10
Submit Proposal for Term Project

Preparation for Class

Review all you have read about inheritance and read chapter 10 which takes us on to virtual functions and polymorphism.
As you read this material, consider that Polymorphism is what we are trying to get - but don't yet have with the features we have learned so far. Each added bit of info is getting us closer to truly polymorphic objects. Try to understand how each feature contributes to this.

Topics Covered in this Class

Review of Basic Inheritance
Class Relationships
Base and derived classes - Shapes Example
Definition of protected access (9.3)
Casting base to derived pointers - (9.4)
Why you should not do this
Overriding member functions (9.6)
Kinds of inheritance (9.7,  9.8)
What you need to know
Order of constructors and destructors (9.9)
Use of base class pointers (9.10)
When access is denied
Inheriting from someone else's code (9.11)
Other kinds of relationships (9.12, 9.13)
Case Study - Point, Circle,  Cylinder (9.14)
What's wrong with this design
Case Study - SmartRect
Case Study - TicTacToe
What Basic Inheritance Gives Us
What we can do do far
What we would like to do
Shapes
TicTacToe
Workarounds
Type Fields and Switch Statements (10.2)
"What am I" functions
Runtime Type Information (RTTI)
Extending Inheritance
Virtual Functions (10.3)
Abstract and Concrete Classes (10.4)
Polymorphism  (10.5)
TicTacToe Revisited
Shapes Revisited
Adding a new Class to Shapes (10.7)
Need for Virtual Destructors (10.8)
Case Studies (10.6 & 10.9)
Under the Hood (10.10)

Assignments

To Be Discussed in Class
Program #7

Back Up Next

Home Windows C++ 241 C++ 242 Contact Info Contents

Copyright © 2000  Charlie Poole. All rights reserved.
Revised: July 15, 2002 - cpoole@ctc.edu