Virtual Extension Methods for Java

Alex Buckley and Brian Goetz

Abstract

Java's rigid mechanism for interface definition is a double-edged sword; while it provides a clean separation of interface contract from implementation, it also means publishers of long-lived libraries have little opportunity for library evolution, accelerating the obsolescence of otherwise viable libraries.

In this talk, we present a mechanism for gradually evolving interface contracts in Java via /virtual extension methods/. Virtual extension methods are a limited form of stateless traits, and provide library writers with a means for controlled evolution of their APIs without "monkey patching." This mechanism is scheduled for inclusion in a future version of the Java language and virtual machine.

About the speakers:

Brian Goetz is Java Language Architect at Oracle Corporation.

Alex Buckley is Java Language and VM Specification Lead at Oracle Corporation.

Slides

o

Invited talk at FOOL 2011; Sunday, 23 October 2011; Portland, Oregon, USA