- S: Single-responsiblity principle.
- O: Open-closed principle.
- L: Liskov substitution principle.
- I: Interface segregation principle.
- D: Dependency Inversion Principle
Composition vs Aggregation
Both are Association
- Composition: A “owns” B
- Aggregation: A “uses” B
- hide complex logic by providing an clean interface (just a wrapper?)
- Iterator provides a way to access an aggregate object without exposing internal representations
- Each Iterator is responsible to maintain the current element
- Each iterator is associated with its aggregate, so aggregate object should implement Aggregate (Iterable) interface which supports the createIterator
 Gamma, Erich. Design patterns: elements of reusable object-oriented software. Pearson Education India, 1995.