Search

DeepFJig — Modular composition of nested classes

By: Andrea Corradi, Marco Servetto, Elena Zucca

Abstract

We present a new language design which smoothly integrates modular composition and nesting of Java-like classes. That is, inheritance has been replaced by an expressive set of composition operators, inspired by Bracha's Jigsaw framework, and these operators allow to manipulate (e.g., rename or duplicate) a nested class at any level of depth. Typing is nominal as characteristic of Java-like languages, so types are paths of the form outer^n .C1 . . . . .Ck which, depending on the class (node) where they occur, denote another node in the nesting tree. However, paths denoting the same class are not equivalent, since they behave differently w.r.t. composition operators. The resulting language, called DeepFJig, obtains a great expressive power, allowing, e.g., to solve the expression problem, encode basic AOP mechanisms, and bring some refactoring techniques at the language level, while keeping a very simple semantics and type system which represent a natural extension for, say, a Java programmer.

Keywords

Java, module composition, nested classes

Cite as:

Andrea Corradi, Marco Servetto, Elena Zucca, “DeepFJig — Modular composition of nested classes”, Journal of Object Technology, Volume 11, no. 2 (August 2012), pp. 1:1-42, doi:10.5381/jot.2012.11.2.a1.

PDF | DOI | BiBTeX | Tweet this | Post to CiteULike | Share on LinkedIn