Angelika Langer - Training & Consulting

 
HOME | SEMINARS | TALKS | ARTICLES | BOOKS | LINKS | IOSTREAMS | GENERICS | ABOUT | NEWSLETTER | CONTACT | SITEMAP
Links - Java Generics

 
HOME 
SEMINARS 
TALKS 
ARTICLES 
BOOKS 

LINKS
  OVERVIEW

  JAVA
    J2SE
    CONCURRENCY
    GENERICS
    PERFORMANCE
    J2EE

  C++
    LANGUAGE
    TEMPLATES
 

IOSTREAMS 
GENERICS 
ABOUT 
NEWSLETTER 
CONTACT 
SITEMAP 
Links - Java Generics

Below is a directory of websites and resources related to Java Generics, a language feature added to the Java programming language with version 5.0 of J2SE. Most of the resources are in English, some in German.
 

Tutorial

TUTORIAL: Generics in the Java Programming Language
An excellent tutorial for Java Generics by Gilad Bracha of Sun Microsystems published in February 2004 and updated in July 2004.

FAQ

FAQ: Java Generics FAQ
A FAQ maintained by Angelika Langer.  Answers to frequently asked questions related to Java Generics. Still under construction.  Covers the basics of Java Generics so far.  Submit questions using this form .

Specification

SPECIFICATION: Java Language Specification, 3rd Ed.
The final specification is part of the 3 rd edition of the Java Language Specification ( JLS 3 ), which has been published in April 2005 and is available at the URL above.

Specification Request JSR014

JSR Group
The official site for specification request JSR014 "Adding Generic Types to the Java Programming Language". The Proposed Final Draft of the Java Generics Specification came out in July 2004. The final specification will be integrated in the 3rd edition of the Java Language Specification (JLS 3), but is not yet available. Only a draft of JLS 3 is available for download.

J2SE 5.0 Release
A release of J2SE 5.0 is available for download since September 2004.

WebLogs, Discussion Forums

FORUM: Generics Discussion Forum
A forum hosted by Sun Microsystems for discussion of Java Generics as well as other language feature added to the language in J2SE 5.0.

WEBLOG: Peter von der Ahé's Weblog
A weblog by Peter von der Ahé of Sun Microsystems.  He posts answers to frequently asked questions on wildcards, type inference and other issues related Java Generics.

WEBLOG: Neal Gafter's Weblog
A weblog by Neil Gafter.  He developed  Sun Microsystems' Java 5.0 compiler including the support of generics.

WEBLOG: Bruce Eckel's Weblog
Some weblog entries by Bruce Eckel are devoted to Java generics.  Bruce is author of "Thinking in Java" and several other books.

WEBLOG: Keith Lea's Weblog
A weblog entry by Keith Lea devoted to Java generics.  He points out limitations of Java as currently available in Java 5.0 and provides his feature wishlist.

Books

BOOK: Generics and Collections in Java 5
A book by Maurice Naftalin and Philip Wadler published in October 2006. More than half of the book is devoted to generics and it covers them thoroughly. Currently the most comprehensive explanation of Java generics in any book that we know of.  The final draft is available online.

BOOK (in German): Fortgeschrittene Programmierung mit Java 5
A book in German by Johannes Nowak published by Dpunkt Verlang in November 2004.  The book is an introduction to new features in Java 5.0 and also covers Java Generics.  It is a typical tutorial with lots of relatively simple code examples that provides the type and level of  information and insight than can be found in other tutorials as well.

BOOK (in German): Das Tiger-Release: Java 5 im Einsatz - Generics, Enums, Concurrent Programming
A book in German by Friedrich Esser published by Galileo Press in September 2004.  The book covers new language features in Java 5.0 and among them Java Generic.  This book is not meant as a tutorial, but provides a fairly challenging explanation of the principles of Java Generics. The book is a little difficult to read, mainly because of the author's writing style and the condensed examples he uses.

BOOK: Core Java, Vol. 1 - Fundamentals, 7th Ed.
A Java textbook by Cay Horstmann and Gary Cornell published by Prentice Hall in August 2004. It is an excellent textbook covering the Java programming language.  It has been updated to cover generics and provides a fairly comprehensive overview of the generics language feature.

BOOK: Java 1.5 Tiger
A book by Brett McLaughlin and David Flanagan published by O'Reilly in Juni 2004. A brief overview of the new language feature in Java 5.0. Well written, with lots of examples.  It is very short on generics.

Articles and Papers

This list is fairly long and continuously growing.  Articles are listed roughly in the order they were published, youngest publications first.
WEBLOG: Super Type Tokens
A weblog by Neil Gafter of Google written on December 4, 2006.  There are not class literals for parameterized types due to type erasure, but sometimes you wished you had a type representation even for a parameterized type.  Neil's type token is a pretty neat idea for a work-around. See also the follow-up .

WEBLOG: Self types (aka type of this)
A weblog by Peter von der Ahé of Sun Microsystems written on November 16, 2006.  Discusses Laird Nelson 's case study and shows an alternative and much simpler design and implementation.

WEBLOG: I am thoroughly humbled by generics
A weblog by Laird Nelson written on October 31, 2006.  Another interesting case study of the design and implementation of a bunch of generic classes and interface.  Illustrates the difficulties (the author even talks of a "disaster") that programmers tend to encounter when they generously introduce an abundance of type parameters.  See also Peter von der Ahé 's alternative approach.

ARTICLE: Strategy Pattern with Generics
An article by Heinz Kabutz discussing the use of generics for implementation of the Strategy pattern.  An interesting case study that demonstrates some of the typical difficulties that programmers struggle with when using Java generics. Published in March 2006. Note also the interesting counterpart in C++ written by  Radu Braniste in April 2006.

SLIDES:  Effective Java Reloaded
Joshua Bloch's presentation at JavaOne 2006. It has some interesting example of using and abusing Generics.

ARTICLE: Reflecting Generics - Generics add type information that classworking tools can use
An article by Dennis Sosnoski on use of reflection for retrieval of information about generic types and methods. Published in November 2005.

INTERVIEW: Migrating to Tiger: James Gosling and Mark Reinhold on Java 2 Platform, Standard Edition 5.0
An interview on Java 5.0, whether it's worth migrating to 5.0, what people complain about and future directions.

COURSE NOTES: Generics in Java 5
The notes of a course on data structures held at the University of Sussex by Peter Williams in the summer of 2005.  It has a section on Java Generics.

SLIDES: Programming With Parameterized Types in Java 5.0
The slides of a technical session at JavaOne 2005 given by Angelika Langer in June 2005.  Gives an overview of the key features of Java Generics and discusses typical issues that developers face when they implement a generic class.

SLIDES: Generic Dos and Don'ts
The slides of a BOF session at JavaOne 2005 by Janet Koenig, Peter von der Ahé, and Madhava Avvari of Sun Microsystems in June 2005.  Discusses various pitfalls of Java Generics.

WEBLOG: Generics Considered Harmful
A weblog by Ken Arnold of Sun Microsystems.  Claims provocatively that adding generics to the Java programming language was a mistake.  See also the reply by Peter von der Ahé.

WEBLOG: Generic Wishlist and Generics Can Force Uncomfortable Design
Two weblog entries by David Hall.  Another wishlist for further generics features (February 2005) and the discussion of a common problem with the Comparable interface (May 2005).

ARTICLES: Good, bad and ugly of Java Generics
An series of 3 articles and the slides of a conference presentation by Venkat Subramaniam in March 2005.  The articles provide another nice tutorial to Java Generics.

ARTICLE:  Generics gotchas: Identify and avoid some of the pitfalls in learning to use generics
An article by Brian Goetz published in his column "Java Theory and Practice" at the IBM Developer Works site in January 2005.
ARTICLE:  Java Generics and Delving further with Java generics
An article and a followup by John Hunt in January/February 2005. Another introduction to Java Generics.

TUTORIAL: Introduction to generic types in JDK 5.0
A tutorial by Brian Goetz published at the IBM Developer Work site in Decvember 2004.

WEBLOG: What Java Generics Needs
A weblog entry by Keith Lea in December 2004.  A wishlist for further generics features.

WEBLOG: Puzzling Through Erasure: answer section
A weblog entry by Neil Gafter in September 2004.  A clarification regarding the design decision related to type erasure and reification.

ARTICLE: Case Study: Converting to Java 1.5 Type-Safe Collections
An article by Wes Munsil published in the Journal of Object Technology ( JOT ) in September 2004.

ARTICLE: Some Examples of Generics in Java 1.5 and C# 2.0
An article by Richard Wiener published in the Journal of Object Technology ( JOT ) in September 2004. The author evaluates the code specialization for value types in C# and the wildcards in Java.

ARTICLE:  Taming Tiger, Part 2 - Understanding Generics
An article by Tarak Modi published in Java World in June 2004. A brief introduction with a few simple examples.

ARTICLE: Adding Wildcards to the Java Programming Language
An article by the designers of wildcards (several individuals at the university of Aarhus and at Sun Microsystems, Inc.) published in the Journal of Object Technology ( JOT ) in April 2004.

ARTICLE: Wildcard Instantiations of Parameterized Types
A series of 2 articles by Klaus Kreft & Angelika Langer published in May 2004. Part 1 explains the purpose and use of the wildcards language construct in Java Generics. Part 2 covers using wildcard instantiations and looks at some of their limitations.

ARTICLE: Language Features of Java Generics
An article by Klaus Kreft & Angelika Langer published in March 2004. An introduction and overview of the major features of Java Generics. Part 1 discusses parameterized types in general using parameteriezed collections as an example. Part 2 covers parameterized methods as well as some aspects of the inner workings of Java Generics such as translation by type erasure.

ARTICLE: An Introduction to Generics in Java
An article by  John Anthony and Scott Chalfant. published in March 2004. An introduction and overview of the major features of Java Generics.

LINKS: Papers describing new language features in J2SE 5.0.
A collection of links to various papers related to Java generics hosted by Sun Microsystems, Inc.

SLIDES: Wildcards in Generics
The slides of a lecture given by Christian Plesner Hansen at the University of Aarhus, Denmark in February 2004.  Explains the reasoning for addition of wildcards to the language. Excellent background information. Links to further documents can be found in the overview of the course on "Types in Object-Oriented Languages" conducted at the University of Aarhus.

ARTICLE: Wildcards in the Generics Specification
An article by William Grosso published in January 2004. An brief, yet excellent explanation of some aspects of wildcards, more of a motivating example rather than a comprehensive coverage of the topic.

ARTICLE: Talking Tiger, generically speaking
An introduction to Java Generics by Matt Quail published in 2003. Very shallow; has bugs like showing an immutable pair class that is not immutable.  Listed for sake of comprehensiveness only.

ARTICLE: Arrays in Java Generics
A brief article by Angelika Langer, that explains a couple of issues in conjuction with arrays in Java Generics. In particular it shows why arrays of parameterized types are illegal in Java Generics.

QUIZ: Java 5.0 Generics
A quiz which you can use to test your understanding of Java Generics. It's quite instructive and fun.

ARTICLE: Generics, Erasure, and Bridging
An article by William Grosso published in December 2003. Good explanation of the principles of type erasure and bridge methods.

WEBLOG: Self-bounding generics
A weblog by Bruce Eckel written in June 2003.  Mulls over constructs such as class SelfBounded<T extends SelfBounded<T>> and raises more questions than it answers.  Yet interesting.

CONVERSATION: New Language Features for Ease of Development in the Java 2 Platform, Standard Edition 5.0
A conversation led with Joshua Bloch in May 2003 about the new 5.0 anguage features.

ARTICLE: Java generics without the pain
A series of four articles by Eric Allen published in February-May 2003  at the IBM Developer Works site.

ARTICLE: Preparing for Generics
An introduction to Java Generics by Paul Mingardi published in November 2002.

ARTICLE: Java generics without the pain
A mini series of articles on Java Generics written by Eric Allen hosted by IBM.

PAPERS: Bibliography
A directory of links to articles and papers related to Java Generics.  It's the bibliography of a paper in German prepared by Heiko Minning.

ARTICLE: Generische Programmierung in Java
An article in German by Ulrich Eisenecker und Krzystof Czarnecki.

PAPERS: Papers by Philip Wadler
A directory of articles on GJ and Pizza by Philip Wadler.

PAPERS: Papers by Martin Odersky
A directory of articles on GJ, Pizza and other topics such as type systems and functional programming written by Martin Odersky of Ecole Polytécnique Fédérale de Lausanne.
 

Topics Related to Java Generics

Adding Wildcards to the Java Programming Language
An ACM paper by Torgersen, Hansen, Ernst, Ahe, Bracha and Gafter, published 2004.  This paper explains in which form variance has been integrated into Java Generics.  In particular it describes the wildcard mechanism itself, its impact on type inference and a feature named wildcard capture.

VGJ - Variant Generic Java
A page maintained devoted to the variance concept in Java Generics. Variance, also known as wildcards, is one of the features supported by Java Generics. A compiler for Java with variance, called VGJ, has been developed as a joint project between the University of Aarhus and Sun Microsystems.

Type Inference
A sample program by Alan Jeffrey  of DePaul University Chicago, that demonstrates a problem in the type inference concept of Java Generics.  The problem has been fixed in the meantime.


Predecessors of Java Generics

This is a list of implementations and considerations for addition of generic types and methods, that were made before Java Generics were added to the the Java Standard Edition.  It is instructive to take a look at them in order to understand how they differ from Java Generics as defined by the JSR014 specification group.
NextGen
An alternative to JSR014 Java Generics develop at Rice University. Quote from their page: "NextGen is an efficient and compatible extension of the Java programming language with support for generic types. Unlike other extensions of Java with genericity, such as GJ and JSR-14, NextGen does not restrict the programmer from using generic types in "type-dependent" contexts, such as casts, "instanceof" tests, and "new" operations. Nevertheless, NextGen maintains full compatibility with the JVM and existing compiled binaries."

GJ (Generic Java)
The predecessor of JSR014 Java Generics that comes closest to what generics are today. GJ was designed by Gilad Bracha of JavaSoft, Martin Odersky of the University of South Australia, David Stoutamire of JavaSoft, and Philip Wadler of Bell Labs, Lucent Technologies.

Pizza
The predecessor fo GJ, that is, the implementation of generics from which GJ was derived. In addition to Generics it supports function pointers and algebraic types.


Generics in other languages

This list should actually include material to C++ templates and Ada or Eiffel generics, but I restrict it to C# generics, because C# is similar and comparable to Java, while neither C++ nor Ada are.
LINKS: C# Generics
In parallel to the specification of Java Generics at Sun Microsystems, Microsoft works on adding generics to C#.  It's kind of instructive to compare the solutions found for C# generics to those implemented in Java generics, since the languages are so similar. There is further information at a site maintained by David Jeske and a research paper by Kennedy and Syme of Microsoft Research in Cambridge, UK.

CONVERSATION: Generics in C#, Java, and C++ - A Conversation with Anders Hejlsberg, Part VII
A conversation that Bill Venners and Bruce Eckel had in January 2004 with Anders Hejlberg, the inventor of C#, about generics in the "curly brace" family of programming languages.

WEBLOG: Generics Aren't
In his weblog Bruce Eckel expresses his astonishment regarding the features of Java generics - or the lack thereof.- following by some thoughts on strong, weak, loose and latent typing.  Basically he is putting Java generics into perspective comparing it to related features in other languages such as C++, Python, Smalltalk.


Type Theory

Object-Oriented Type Systems
A book by Jens Palsberg and Michael I. Schwartzbach, published by Wiley in 1994 (ISBN 047194128X ). A textbook on the key aspects of object-oriented type systems.

Types in Object-Oriented Languages
A course conducted by Mads Torgersen at Aarhus University in spring 2004.  The course investigates the current state of the art of type systems for object-oriented programming languages, with special attention to the recent enhancement of the Java type system with genericity and variance constructs. Course handouts and related reading are great resources for background information on Java Generics.
 

Refactoring

Refactoring non-generic programs to use generic libraries is a problem that many Java programmers face when they move to Java 5.0 and want to re-engineer existing Java programs.  Research is done to develop automatic refactoring.  The result of this research will be available in Java IDEs some time in the future.
PAPER: Converting Java programs to use generic libraries
A paper by Alan Donovan, Adam Kiezun, Matthew S. Tschantz, and Michael D. Ernst published in the proceedings of  OOPSLA 2004 in November 2004. The authors present research for refactoring non-generic Java programs to use generic libraries such as the collections from the java.util package.

PAPER: Refactoring Techniques for Migrating Applications to Generic Java Container Classes
A paper by Robert Fuhrer, Frank Tip, Adam Kiezun, Julian Dolby, and Markus Keller presented at ECOOP 2005 in July 2005. The paper presents a method for refactoring Java programs that use current container classes into equivalent Java 1.5 programs that use their new generic counterparts. An earlier version of the paper was published as an IBM Research Report in June 2004.
 
 
 


 
© Copyright 1995-2007 by Angelika Langer.  All Rights Reserved.    URL: < http://www.AngelikaLanger.com/Resources/Links/JavaGenerics.htm  last update: 31 Jan 2007