Guests Bring Work

The Visitor pattern makes it easy to add new operations over a class hierarchy. What is the well-known trade-off?

A

Visitor introduces significant runtime overhead due to triple dispatch

B

Visitor requires all elements to be stored in contiguous memory

C

Visitor makes it easy to add new operations but hard to add new element types, because every visitor must be updated

D

Visitor cannot work with polymorphic hierarchies