A Programmer's Reduction Semantics for Classes and Mixins (1999)
Cached
Download Links
- [www.ccs.neu.edu]
- [www.cs.rice.edu]
- [www.cs.rice.edu]
- DBLP
Other Repositories/Bibliography
| Citations: | 81 - 8 self |
BibTeX
@MISC{Flatt99aprogrammer's,
author = {Matthew Flatt and Shriram Krishnamurthi and Matthias Felleisen},
title = {A Programmer's Reduction Semantics for Classes and Mixins},
year = {1999}
}
Years of Citing Articles
OpenURL
Abstract
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 Organizing Programs with Functions and Classes Object-oriented programming languages offer classes, inheritance, and overriding to parameterize over program pieces for management purposes and re-use. Functional programming languages provide various flavors of functional abstractions for the same purpose. The latter model was developed from a well-known, highly developed mathematical theory. The former grew in response to the need to manage large programs and to re-use as many components as possible. Each form of parameterization is useful for certain situations. With higherorder functions, a programmer can easily define many functions that share a similar core but differ in a few details. As many language designers and programmers readily acknowledge, however, the functional approach to parameterization is best used in situations with a relatively small number of parameters. When ...







