Double-Dispatch

Visitor

A page editor's three block classes keep gaining operations. Learn how double dispatch lets one accept method serve any number of visitors, what it costs, and when a sealed interface and a pattern switch is the better answer.

November 26, 202611 minutes