Results 1 -
2 of
2
CZ: Multiple Inheritance Without Diamonds
"... Multiple inheritance has long been plagued with the “diamond” inheritance problem, leading to solutions that restrict expressiveness, such as mixins and traits. Instead, we address the diamond problem directly, considering two difficulties it causes: ensuring a correct semantics for object initializ ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
Multiple inheritance has long been plagued with the “diamond” inheritance problem, leading to solutions that restrict expressiveness, such as mixins and traits. Instead, we address the diamond problem directly, considering two difficulties it causes: ensuring a correct semantics for object initializers, and typechecking multiple dispatch in a modular fashion—the latter problem arising even with multiple interface inheritance. We show that previous solutions to these problems are either unsatisfactory or cumbersome, and suggest a novel approach: supporting multiple inheritance but forbidding diamond inheritance. Expressiveness is retained through two features: a “requires ” construct that provides a form of subtyping without inheritance (inspired by Scala [40]), and a dynamically-dispatched “super ” call similar to that found in traits. Through examples, we illustrate that inheritance diamonds can be eliminated via a combination of “requires ” and ordinary inheritance. We provide a sound formal model for our language and demonstrate its modularity and expressiveness.
OOMatch: Pattern Matching as Dispatch in Java
, 2007
"... We present an extension to Java, dubbed OOMatch. It allows method parameters to be specified as patterns, which are matched against the arguments to the method call. When matches occur, the method applies; if multiple methods apply, the method with the more specific pattern overrides the others. ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
We present an extension to Java, dubbed OOMatch. It allows method parameters to be specified as patterns, which are matched against the arguments to the method call. When matches occur, the method applies; if multiple methods apply, the method with the more specific pattern overrides the others.

