类图:
理解这种模型最简单的方式: 现在有一个数组array (相当于 Aggregate这个集合类),。 如果要想遍历这个数组那么只需要有这个数组的下标就行了,这个下标就相当于这里的Iterator (注意:Aggregate 与 Iterator是一一对应的关系, 也就是说不同的Iterator 只能遍历相应的 Aggregate).
通过上面的分析, 迭代器就能够变为图2的形式。