Introduction to Object Oriented Programming, 3rd Ed
Chapter 19
Container Classes
Outline
- Roadmap
- Containers in Dynamically Typed Languages
- Tension between Strong Typing and Reuse
- Can OO Techniques Solve This?
- Using Substitution and Downcasting
- Heterogeneous Collections
- Using Classes as Objects to do Type Checking
- Storing Primitive Values
- Using Substitution and Overriding
- An Example, Java Window Events
- A Third Alternative, Generics
- Collection Traversal
- Two Solutions
- Iterators
- An Enumeration Loop in Java
- An Iterator Loop in C++
- Iterators and Encapsulation
- Alternative, the Visitor
- The Visitor in C++ in the STL
- Chapter Summary
Other Material