Interface-Scoped Dispatch: General Delegation with O(1) Self-Calls
The conceptual appeal of object composition is its ability to build loosely coupled systems from independent runtime components. Yet conventional languages prevent composition from fully realizing this potential, due to the absence of late-bound self-calls (open recursion), a defining strength of implementation inheritance. Filling this gap while fully retaining the properties of object composition remains an unmet challenge. We present Parts, a general delegation model that meets this challenge by unifying independent runtime components, arbitrary composition, and open recursion. Its enabling mechanism, interface-scoped dispatch (ISD), assigns composite identity per interface at construction, allowing self-calls to dynamically dispatch through overriding composites. Parts is realized as a compiler plugin for Java 8-27 with IDE integration. It achieves an O(1) dispatch cost that is empirically equivalent to a standard vtable call, offering open recursion through composition without compromise.
Authors
- Robert Scott McKinney
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-10-03
- DOI
- https://doi.org/10.5281/zenodo.23114708
- Primary Topic
- Advanced Software Engineering Methodologies
- Type
- preprint