> Design Patterns > Visitor > Visitor Design Pattern In Python

Visitor Design Pattern In Python

Visitor design pattern in Python to perform operation on elements of an object structure.


Visitor design pattern In Python

Output

ConcreteElementA::Accept()
ConcreteVisitor1::VisitConcreteElementA()
ConcreteElementA::Accept()
ConcreteVisitor2::VisitConcreteElementA()
ConcreteElementB::Accept()
ConcreteVisitor1::VisitConcreteElementB()
ConcreteElementB::Accept()
ConcreteVisitor2::VisitConcreteElementB()


Suresh Kumar Srivastava is founder of online learning site coursegalaxy.com and author of popular books C In Depth, Data Structures Through C In Depth. He has 18+ years experience in industry and worked on architecture and design of multiple products. This article Visitor Design Pattern In Python is from his Design Patterns course.