Interface-Scoped Dispatch: Independent Components with O(1) Self-Calls
Object composition under static typing forces a trade: independent components, or open recursion. Forwardingbased constructs compose independent components, but a component’s self-calls do not dispatch through the composite. Trait/mixin composition preserves self-call dispatch at the expense of independent components. Approaches that combine the two surrender the components’ independence, fusing them into the class or binding them to an enclosing family. Composing independent components with open recursion has remained open. We present Parts, a compositional model that unifies independent components and open recursion, realized as a compiler plugin for Java 8–26. A part is an independent component, supplied as a runtime object at construction, whose self-calls route through the composite; the enabling mechanism, interface-scoped dispatch (ISD), assigns composite identity per interface rather than per object. Self-calls route through the correct composite in arbitrary compositions. The dispatch cost is O(1), empirically equivalent to a vtable call.
Authors
- Robert Scott McKinney
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-07-23
- DOI
- https://doi.org/10.5281/zenodo.21514974
- Primary Topic
- Advanced Software Engineering Methodologies
- Type
- preprint