Selective method combination in mixin-based composition

  • Authors:
  • Tetsuo Kamina;Tetsuo Tamai

  • Affiliations:
  • The University of Tokyo, Tokyo, Japan;The University of Tokyo, Tokyo, Japan

  • Venue:
  • Proceedings of the 2005 ACM symposium on Applied computing
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

A mixin is a reusable module that provides uniform extensions and modifications to classes. It is an abstract subclass that is composable with a variety of superclasses. In mixin-based composition, however, the problem of accidental overriding arises. A method declared in a mixin may accidentally overrides its superclasses' method. To tackle this problem, we propose a new approach of method lookup that allows selective method combination; that is, when we have multiple methods with the same name and the same formal parameter types in a composition, we can select which method to execute, and which method is called when there exists a method call to super. This proposal is an extension of hygienic mixins with stronger expressive power. This proposal is implemented in McJava, an extension of Java with mixintypes. Its compilation is achieved by source code translation to Java thus making it runnable on a standard Java virtual machine.