Professional Documents
Culture Documents
Experiment-15:
Aim: Using UML Design visitor Design pattern.
Theory:
In Visitor pattern, we use a visitor class which changes the executing algorithm of an
element class. By this way, execution algorithm of element can vary as and when visitor
varies. This pattern comes under behavior pattern category. As per the pattern, element
object has to accept the visitor object so that visitor object handles the operation on the
element object.
Intent
Represent an operation to be performed on the elements of an object structure. Visitor
lets you define a new operation without changing the classes of the elements on which it
operates.
Applicability
Use the Visitor pattern when
a. an object structure contains many classes of objects with differing interfaces, and you
want to perform operations on these objects that dependon their concrete classes.
WWW.KVRSOFTWARES.BLOGSPOT.COM/
53
Class Diagram:
WWW.KVRSOFTWARES.BLOGSPOT.COM/