Breaking Dependencies - The Visitor Design Pattern in Cpp - Klaus Iglberger - CppCon 2022

--- Breaking Dependencies - The Visitor Design Pattern in C - Klaus Iglberger - CppCon 2022 The extensibility of code with new functionality is essential for long-term maintenance of a code base. However, when using dynamic polymorphism there is always a choice: either easily add types, or easily add operations. For instance, by means of inheritance hierarchies it’s easy to add new types, but it’s difficult to add new operations. But there is a common workaround to overcome this weakness: the Visitor design pattern. In this talk, I’ll explain the design properties of Visitor, including its benefits and shortcomings. I’ll also talk about different kinds of visitors (cyclic and acyclic) and show when to reach for a Visitor and when to avoid it. Additionally, I’ll demonstrate the different implementation strategies (classic and modern) and address their individual benefits and problems. --- Klaus Iglberger
Back to Top