Polski

Behavioral patterns

Visitor

Adds new operations to an object structure without modifying its classes.

Article

Visitor: new operations without changing classes

The Visitor pattern through a menu: dishes, drinks and sets stay untouched, while pricing, an allergen report or an export are separate visitor objects. Double dispatch, a comparison with pattern matching and code in five languages.

Related articles

Challenges

Around the topic

In this group: Behavioral patterns