🌱Aadam's Garden

Search

Search IconIcon to open search

Visitor Pattern

Last updated Aug 16, 2022

Source:: Software Design Patterns - Best Practices for Software Developers


Definition

The pattern is defined as defining operations to be performed on elements of an object structure without changing the classes of the elements it works on.

The pattern is suitable in scenarios, where the object structure class or the classes that make up its elements don’t change often but new operations over the object structure are desired.