Polymorphism on Steroids – Dive Into Multiple Dispatch (Multimethods)

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.”

Continue Reading

Clash of Styles, Part #6 – FP in OOP via the 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.

Continue Reading

Site Footer