SlideShare a Scribd company logo
 The Visitor Design PatternSamnangChhunYoolk Inc.
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.What this?Open Closed Principle is the keyThe Visitor Design Pattern
Structure
Example
ConsequencesBenefitsAdding new operations is easyRelated behavior isn’t spread over the classes defining the object structure; it’s localized in a visitor. Unrelated sets of behavior are partitioned in own visitor subclasses.LiabilitiesAdding new ConcreteElement class is hard. Each new ConcreteElement give rise to a new abstract operation on Visitor and a corresponding implementation in every ConcreteVisitor class.The ConcreteElement interface must be powerful enough to let visitors do their job. You may be forced to provide public operations that access an element’s internal state, which may compromise its encapsulation.
Don’t forget to review all of them again and again
Thank you!

More Related Content

ODP
Visitor pattern
PPTX
Visitor design patterns
PPTX
Visitor Pattern
PPTX
Visitor design pattern
PDF
Behavioral Design Patterns
ODP
Mediator
PPT
Mediator pattern
PPTX
PATTERNS03 - Behavioural Design Patterns
Visitor pattern
Visitor design patterns
Visitor Pattern
Visitor design pattern
Behavioral Design Patterns
Mediator
Mediator pattern
PATTERNS03 - Behavioural Design Patterns

What's hot (20)

PPTX
Facade Design Pattern
PPTX
PATTERNS04 - Structural Design Patterns
PPTX
Design Patterns - 01 Introduction and Decorator Pattern
PPTX
React hooks
PPT
Bridge pattern
PPTX
Design patterns english
PPT
Software Design Patterns
PPTX
PATTERNS02 - Creational Design Patterns
PPT
Command Design Pattern
PPT
Chain of responsibility
PPTX
Java Chapter 04 - Writing Classes: part 1
PDF
I can see your house from here
PPT
Design pattern composite 20120413 joncash 01
PDF
Bridge Pattern
PDF
Understanding react hooks
PDF
Understanding React hooks | Walkingtree Technologies
DOCX
Design patterns
PPT
Command Design Pattern
PPT
Lesson10 behavioral patterns
PPT
Lesson12 other behavioural patterns
Facade Design Pattern
PATTERNS04 - Structural Design Patterns
Design Patterns - 01 Introduction and Decorator Pattern
React hooks
Bridge pattern
Design patterns english
Software Design Patterns
PATTERNS02 - Creational Design Patterns
Command Design Pattern
Chain of responsibility
Java Chapter 04 - Writing Classes: part 1
I can see your house from here
Design pattern composite 20120413 joncash 01
Bridge Pattern
Understanding react hooks
Understanding React hooks | Walkingtree Technologies
Design patterns
Command Design Pattern
Lesson10 behavioral patterns
Lesson12 other behavioural patterns
Ad

Viewers also liked (7)

PPT
The Visitor Pattern
PDF
Applying Design Patterns in Practice
PDF
PPT
Thomas hardy
PPT
Introduction to Thomas Hardy
PPTX
The Role of Enterprise Integration in Digital Transformation
PPT
Design Patterns
The Visitor Pattern
Applying Design Patterns in Practice
Thomas hardy
Introduction to Thomas Hardy
The Role of Enterprise Integration in Digital Transformation
Design Patterns
Ad

More from Samnang Chhun (10)

PDF
Find your passion
PDF
Software developer career growth
PDF
Why i love ruby than x
PDF
12 Things Every Programmer Should Know
PDF
Peforming Code Katas
PDF
Introduction To Share Vision
PDF
Test Driven Development
PDF
Version Control With Subversion
PPTX
Layering
PDF
NHibernate (The ORM For .NET Platform)
Find your passion
Software developer career growth
Why i love ruby than x
12 Things Every Programmer Should Know
Peforming Code Katas
Introduction To Share Vision
Test Driven Development
Version Control With Subversion
Layering
NHibernate (The ORM For .NET Platform)

Recently uploaded (20)

PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Pharma ospi slides which help in ospi learning
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Pre independence Education in Inndia.pdf
PPTX
Lesson notes of climatology university.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
GDM (1) (1).pptx small presentation for students
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Institutional Correction lecture only . . .
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
RMMM.pdf make it easy to upload and study
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Cell Structure & Organelles in detailed.
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Cell Types and Its function , kingdom of life
TR - Agricultural Crops Production NC III.pdf
PPH.pptx obstetrics and gynecology in nursing
Anesthesia in Laparoscopic Surgery in India
Pharma ospi slides which help in ospi learning
Microbial disease of the cardiovascular and lymphatic systems
Pre independence Education in Inndia.pdf
Lesson notes of climatology university.
Final Presentation General Medicine 03-08-2024.pptx
GDM (1) (1).pptx small presentation for students
Module 4: Burden of Disease Tutorial Slides S2 2025
Institutional Correction lecture only . . .
Microbial diseases, their pathogenesis and prophylaxis
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
RMMM.pdf make it easy to upload and study
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Cell Structure & Organelles in detailed.
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
102 student loan defaulters named and shamed – Is someone you know on the list?
Cell Types and Its function , kingdom of life

The visitor design pattern

  • 1. The Visitor Design PatternSamnangChhunYoolk Inc.
  • 2. 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.What this?Open Closed Principle is the keyThe Visitor Design Pattern
  • 5. ConsequencesBenefitsAdding new operations is easyRelated behavior isn’t spread over the classes defining the object structure; it’s localized in a visitor. Unrelated sets of behavior are partitioned in own visitor subclasses.LiabilitiesAdding new ConcreteElement class is hard. Each new ConcreteElement give rise to a new abstract operation on Visitor and a corresponding implementation in every ConcreteVisitor class.The ConcreteElement interface must be powerful enough to let visitors do their job. You may be forced to provide public operations that access an element’s internal state, which may compromise its encapsulation.
  • 6. Don’t forget to review all of them again and again