Method Mixins

  • Erik Ernst

Abstract

The procedure call mechanism has conquered the world of programming, with object-oriented method invocation being a procedure call in context of an object. This paper presents an alternative, method mixin invocations, that is optimized for flexible creation of composite behavior, where traditional invocation is optimized for as-is reuse of existing behavior.

Tight coupling reduces flexibility, and traditional invocation tightly couples transfer of information and transfer of control. Method mixins decouple these two kinds of transfer, thereby opening the doors for new kinds of abstraction and reuse. Method mixins use shared name spaces to transfer information between caller and callee, as opposed to traditional invocation which uses parameters and returned results. This relieves a caller from dependencies on the callee, and it allows direct transfer of information further down the call stack, e.g. to a callee's callee.

The mechanism has been implemented in the programming language gbeta. Variants of the mechanism could be added to almost any programming language with mutable state.

Author Biography

Erik Ernst
Published
2002-03-01
How to Cite
Ernst, E. (2002). Method Mixins. DAIMI Report Series, 31(557). https://doi.org/10.7146/dpb.v31i557.7114