The common understanding of Polymorphism takes into account only the runtime type of the “receiving” object. That’s the implementation in most languages. But what if we also consider the method arguments as part of the runtime method resolution logic? That’s the idea behind “Multiple Dispatch.” …
Tag: Visitor Pattern
The Visitor Pattern addresses a fundamental limitation of Object-Oriented modeling. In OOP, adding a new “operation” is tricky. You have to modify the existing classes, which is error-prone and violates OCP. Let’s look beyond the standard UML diagram and see how the Visitor solves this problem. …