Visitor

This is a class diagram example for the Visitor pattern.

Purpose

Allows for one or more operations to be applied to a set of objects at runtime, decoupling the operations from the object structure.

Use When

  • An object structure must have many unrelated operations performed upon it.
  • The object structure can't change but operations performed on it can.
  • Operations must be performed on the concrete classes of an object structure.
  • Exposing internal state or operations of the object structure is acceptable.
  • Operations should be able to operate on multiple object structures that implement the same interface sets.
Import into your Project

Posted by: Shalonda Moran