When you have a complex object structure (element classes) and need to?
perform operations on them that vary.
- For example, in cases where you have a set of classes that are part of a
complex hierarchy (like a shopping cart with various types of products), and
you need to add new behaviors without changing the objects themselves.