Introduction to Object Oriented Programming, 3rd Ed

Timothy A. Budd

Chapter 19

Container Classes

Outline

  1. Roadmap
  2. Containers in Dynamically Typed Languages
  3. Tension between Strong Typing and Reuse
    1. Can OO Techniques Solve This?
    2. Using Substitution and Downcasting
      1. Heterogeneous Collections
      2. Using Classes as Objects to do Type Checking
      3. Storing Primitive Values
    3. Using Substitution and Overriding
      1. An Example, Java Window Events
    4. A Third Alternative, Generics
  4. Collection Traversal
    1. Two Solutions
      1. Iterators
        1. An Enumeration Loop in Java
        2. An Iterator Loop in C++
        3. Iterators and Encapsulation
      2. Alternative, the Visitor
        1. The Visitor in C++ in the STL
  5. Chapter Summary

Other Material

Intro OOP, Chapter 19, Outline