Symmetric Encapsulated Multi-Methods
David Lievens, Bill Harrison

TL;DR
This paper introduces symmetric encapsulated multi-methods, enabling flexible method overriding across classes regardless of subtype relationships, thus enhancing modularity and adaptability in object-oriented programming.
Contribution
It proposes a novel scheme for defining symmetric methods in any class of their parameters, allowing for more modular and extensible object-oriented systems.
Findings
Scheme allows client code to be oblivious of method implementation location.
Enables overriding methods in non-subtype classes with multiple dynamic dispatch.
Proved soundness of the extended core calculus with symmetric multi-methods.
Abstract
In object systems, classes take the role of modules, and interfaces consist of methods. Because methods are encapsulated in objects, interfaces in object systems do not allow abstracting over \emph{where} methods are implemented. This implies that any change to the implementation structure may cause a rippling effect. Sometimes this unduly restricts the scope of software evolution, in particular for methods with multiple parameters where there is no clear owner. We propose a simple scheme where symmetric methods may be defined in the classes of any of their parameters. This allows client code to be oblivious of what class contains a method implementation, and therefore immune against it changing. When combined with multiple dynamic dispatch, this scheme allows for modular extensibility where a method defined in one class is overridden by a method defined in a class that is not its…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Formal Methods in Verification · Advanced Software Engineering Methodologies
