Signing you in…

Visitor

Visitor is a behavioral pattern that lets you add new operations to an existing class hierarchy without modifying those classes. You separate the algorithm from the object structure: instead of adding a new method to every class in the hierarchy, you create a Visitor class with a dedicated method for each class. The classes in the hierarchy only need an accept(Visitor) method — added once, it opens them to unlimited future operations.

ℹ️Core idea: double dispatch — when you call element.accept(visitor), the element's accept() method calls visitor.visit(this), routing execution to the method overload that matches the element's concrete type. This lets you add new operations without touching existing element classes.
Content is available with subscription.
Get full access to all courses on the platform for one year with a single payment.
Unlike other platforms that charge per course, here you get everything for one price, and after one year of use there will be no automatic charge for the following year.