We present FJig, a simple calculus where basic building blocks are classes in the style of Featherweight Java. However, inheritance has been generalized to the more flexible notion proposed in Bracha's Jigsaw framework. We keep the nominal type approach of Java-like languages, however, a class is not necessarily a structural subtype of any class used in its defining expression. The calculus allows the encoding of a large variety of different mechanisms for software composition, including standard inheritance, mixin classes, traits and hiding. Hence, FJig can be used as a unifying framework for analyzing existing mechanisms and proposing extensions. Two different semantics are provided: flattening and direct. The difference is analogous to that between two intuitive models to understand inheritance: where inherited methods are copied into heir classes, and where member lookup ascends the inheritance chain. We address equivalence of these two views for a more sophisticated composition mechanism.

Featherweight Jigsaw: A Minimal Core Calculus for Modular Composition of Classes

LAGORIO, GIOVANNI;ZUCCA, ELENA
2009-01-01

Abstract

We present FJig, a simple calculus where basic building blocks are classes in the style of Featherweight Java. However, inheritance has been generalized to the more flexible notion proposed in Bracha's Jigsaw framework. We keep the nominal type approach of Java-like languages, however, a class is not necessarily a structural subtype of any class used in its defining expression. The calculus allows the encoding of a large variety of different mechanisms for software composition, including standard inheritance, mixin classes, traits and hiding. Hence, FJig can be used as a unifying framework for analyzing existing mechanisms and proposing extensions. Two different semantics are provided: flattening and direct. The difference is analogous to that between two intuitive models to understand inheritance: where inherited methods are copied into heir classes, and where member lookup ascends the inheritance chain. We address equivalence of these two views for a more sophisticated composition mechanism.
2009
9783642030123
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11567/297382
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 19
  • ???jsp.display-item.citation.isi??? 7
social impact