Toward Zero-Overhead Genericity in Java

Generic type definitions can aid software reuse and hence reduce development costs. Reusability should ideally neither compromise program clarity nor incur run-time costs in comparison to one-off programming. In this paper we formulate requirements for a practically acceptable mechanism for genericity in Java. We show that two recent proposals fail to meet the requirements for a test case involving collection types in a data processing application. We suggest an alternative Java extension which is more flexible, clearer and more efficient.

[1]  Kim B. Bruce,et al.  Subtyping Is Not a Good "Match" for Object-Oriented Languages , 1997, ECOOP.

[2]  Martín Abadi,et al.  A Theory of Objects , 1996, Monographs in Computer Science.

[3]  Mark Evered Unconstraining genericity , 1997, Proceedings. Technology of Object-Oriented Languages. TOOLS 24 (Cat. No.97TB100240).

[4]  Andrew C. Myers,et al.  Subtypes vs. where clauses: constraining parametric polymorphism , 1995, OOPSLA.

[5]  Paul Roe,et al.  Lightweight Parametric Polymorphism for Oberon , 1997, JMLC.

[6]  John C. Mitchell,et al.  F-bounded polymorphism for object-oriented programming , 1989, FPCA.

[7]  Ulrich W. Eisenecker Generative Programming (GP) with C++ , 1997, JMLC.

[8]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[9]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[10]  Andrew C. Myers,et al.  Parameterized types for Java , 1997, POPL '97.

[11]  Martin Odersky,et al.  Pizza into Java: translating theory into practice , 1997, POPL '97.

[12]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.