Week 3 - Pointers & Objects, Aggregation
Learning objectives
Upon finishing this week, you should be able to:
- Use objects as input and output for functions
- Recognize how and when to appropriately use const and static class members
- Use composition to build objects from other objects
- Write unit tests for classes
Suggested pacing
Day 1
- Holiday - relax or work ahead
Day 2
- Start on Interacting Objects - Ch 17.1-17.4
- Start Ch 17 Exercises - OO Thinking
Day 3
- Continue Interacting Objects - Ch 17.5-17.9
- Start Ch 17 Exercises - Composition
Day 4
- Continue Interacting Objects - Finish
- Start the assignment. See Assignment section for a video that shows what the file structure and Makefile should look like.
Interacting Objects
Chapter 17 covers writing code involving multiple interacting objects. This includes passing objects to functions, returning objects from functions, and using objects as member variables of other objects (composition).
After you are through section 17.3 watch this video on using the debugger to track passed objects:
Other Videos
These videos cover other topics from Chapter 17. They are not required, but you may find them helpful.
This video discusses const member functions. It also briefly reviews passing objects as const references. (17.1)
This video reviews const members. (17.2)
This video covers static members. (17.4)
This video covers Composition. (17.5-17.8)
This video covers Composition. (17.9)
Assignment
This video walks through what the setup for this week's assignment looks like: