Introduction to OOP
Chapter 19: Container Classes :
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.
, Slide 13