Classes and mixins

While class-based object-oriented programming languages provide a flexible mechanism for re-using and managing related pieces of code, they typically lack linguistic facilities for specifying a uniform extension of many classes with one set of fields and methods. As a result, programmers are unable to express certain abstractions over classes.In this paper we develop a model of class-to-class functions that we refer to as mixins. A mixin function maps a class to an extended class by adding or overriding fields and methods. Programming with mixins is similar to programming with single inheritance classes, but mixins more directly encourage programming to interfaces.The paper develops these ideas within the context of Java. The results are 1. an intuitive model of an essential Java subset; 2. an extension that explains and models mixins; and 3. type soundness theorems for these languages.

[1]  Uday S. Reddy,et al.  Objects as closures: abstract semantics of object-oriented languages , 1988, LISP and Functional Programming.

[2]  Robert R. Kessler,et al.  Lisp, Objects and Symbolic Programming , 1988 .

[3]  Samuel N. Kamin Inheritance in smalltalk-80: a denotational definition , 1988, POPL '88.

[4]  Matthias Felleisen,et al.  Programming languages and lambda calculi , 1989 .

[5]  William R. Cook,et al.  A denotational semantics of inheritance , 1989 .

[6]  William R. Cook,et al.  Mixin-based inheritance , 1990, OOPSLA/ECOOP '90.

[7]  Timothy Koschmann The Common LISP Companion , 1990 .

[8]  Gilad Bracha,et al.  The programming language jigsaw: mixins, modularity and multiple inheritance , 1992 .

[9]  Marie-Laure Mugnier,et al.  Monotonic conflict resolution mechanisms for inheritance , 1992, OOPSLA.

[10]  Robert Hieb,et al.  The Revised Report on the Syntactic Theories of Sequential Control and State , 1992, Theor. Comput. Sci..

[11]  Gilad Bracha,et al.  Modularity meets inheritance , 1992, Proceedings of the 1992 International Conference on Computer Languages.

[12]  Scott F. Smith,et al.  Application of OOP Type Theory: State, Decidability, Integragtion , 1994, OOPSLA.

[13]  Martín Abadi,et al.  A Theory of Primitive Objects - Untyped and First-Order Systems , 1994, TACS.

[14]  Didier Rémy,et al.  Programming Objects with ML-ART, an Extension to ML with Abstract and Record Types , 1994, TACS.

[15]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[16]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[17]  Martín Abadi,et al.  A Theory of Primitive Objects: Second-Order Systems , 1995, Sci. Comput. Program..

[18]  Carolyn L. Talcott,et al.  Reasoning About Object Systems in VTLoE , 1995, Int. J. Found. Comput. Sci..

[19]  Martín Abadi,et al.  An Imperative Object Calculus , 1995, TAPSOFT.

[20]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[21]  Mitchell Wand,et al.  Modeling Subobject-based Inheritance , 1996, ECOOP.

[22]  Davide Ancona,et al.  An Algebraic Approach to Mixins and Modularity , 1996, ALP.

[23]  Sophia Drossopoulou,et al.  Java is Type Safe - Probably , 1997, ECOOP.

[24]  Matthias Felleisen,et al.  DrScheme: A Pedagogic Programming Environment for Scheme , 1997, PLILP.

[25]  Don Syme,et al.  Proving Java Type Soundness , 1999, Formal Syntax and Semantics of Java.

[26]  Matthew Flatt,et al.  PLT MzScheme: Language Manual , 2000 .