JavaGI: A Language with Generalized Interfaces

Stefan Wehr

PhD thesis, Technische Fakultät der Albert-Ludwigs-Universität Freiburg im Breisgau, Germany, August 2010. URL:, URN: urn:nbn:de:bsz:25-opus-76785.


Component-based software development in statically typed, object-oriented programming languages has proven successful in reducing development costs and raising software quality. However, this form of software development still poses many challenges and thus requires better support on the programming language level.

The language JavaGI, a conservative extension of Java 1.5, offers generalized interfaces as an effective improvement. Generalized interfaces subsume retroactive and type-conditional interface implementations, binary methods, symmetric multiple dispatch, interfaces over families of types, and static interface methods. These features allow non-invasive and in-place object adaptation, thus enabling solutions to several software extension, adaptation, and integration problems with components in binary form. Further, they make certain coding patterns redundant and increase the expressiveness of the type system. The generalized interface mechanism offers a unifying conceptual view on these seemingly disparate concerns, for which previously unrelated extensions have been suggested.

This dissertation introduces the language JavaGI by explaining its features and motivating its design. Technical contributions of the dissertation are the formalization of a core calculus for JavaGI and a proof of type soundness, determinacy of evaluation, and decidability of subtyping and typechecking. The formalization also includes a type- and behavior-preserving translation from a significant subset of the core calculus to a slightly extended version of Featherweight Java. Moreover, the dissertation explores two extensions of the type system, which both have undecidable subtyping relations but for which several decidable fragments exist. The undecidability result for one of the extensions sheds light on the decidability of subtyping in Scala and of subtyping with Java wildcards.

On the practical side, the dissertation presents the implementation of a JavaGI compiler and an accompanying run-time system. The compiler is based on an industrial-strength Java compiler and offers mostly modular typechecking but fully modular code generation. It defers certain well-formedness checks until load time to allow for greater flexibility and to enable full support for dynamic loading. Benchmarks show that the code generated by the compiler offers good performance. Several case studies demonstrate the practical utility of the language and its implementation. The implementation also includes a JavaGI plugin for the Eclipse IDE.


  author = {Stefan Wehr},
  title = {{JavaGI}: A Language with Generalized Interfaces},
  month = {August},
  year = 2010,
  school = {{Technische Fakultät der Albert-Ludwigs-Universität Freiburg im Breisgau, Germany}},
  note = {URL: \url{}, URN: \url{urn:nbn:de:bsz:25-opus-76785}}


Imprint & privacy policy // Last modified: 2023-11-27T14:23:35+01:00