Introduction to OOP
Chapter 19: Container Classes :
next
previous
audio
real
text
Two Solutions
There are two common solutions:
Create an iterator; an object that facilitates access to elements and enumeration over the collection.
The vistor. Bundle the action to be performed as an object, and pass it to the collection.
Intro OOP,
Chapter 19
, Slide 13