Visitor

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(Introduction)
(Description)
Line 9: Line 9:
 
*Element: Accepts visits
 
*Element: Accepts visits
 
*Visitor: Accesses an element to perform operations
 
*Visitor: Accesses an element to perform operations
 +
 +
[[image:Visitor.JPG|frame|centre|Visitor Structure]]

Revision as of 07:56, 30 July 2008

Introduction

The Visitor is a behavioural pattern. It allows the designer to define new operations on an object structure and its elements, without modifying the object structure itself.

Description

The Visitor describes three major roles:

  • Object Structure: Provides a visitor with access to its elements
  • Element: Accepts visits
  • Visitor: Accesses an element to perform operations
Visitor Structure
Personal tools