skip to main content
article
Free Access

Adding type parameterization to the Java language

Authors Info & Claims
Published:09 October 1997Publication History
Skip Abstract Section

Abstract

Although the Java programming language has achieved widespread acceptance, one feature that seems sorely missed is the ability to use type parameters (as in Ada generics, C++ templates, and ML polymorphic functions or data types) to allow a general concept to be instantiated to one or more specific types. In this paper, we propose parameterized classes and interfaces in which the type parameter may be constrained to either implement a given interface or extend a given class. This design allows the body of a parameterized class to refer to methods on objects of the parameter type, without introducing any new type relations into the language. We show that these Java extensions may be implemented by expanding parameterized classes at class load time, without any extension or modification to existing Java bytecode, verifier or bytecode interpreter.

References

  1. AG96 Ken Arnold and James Gosling. The Java Programming Language. Addison-Wesley, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. BCC+96 Kim B. Bruce, Luca Oardelli, Giuseppe Gastagna, the Hopkins Objects Group, Gary T. Leavens, and Benjamln Pierce. On binary methods. Theory and Practice of'Object Systems, 1(3):221-242,1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Cas95 Giuseppe Castagna. Covariance and contravariance: Conflict without a cause. A OM Transactions on Programming Languages and Systems, 17(3):431--447, May 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. CCH+89 P. Canning, W. Cook, W. Hill, J. Mitchell, and W. Olthoff. F-bounded quantification for objectoriented programming. In Functional Prog. and Computer Architecture, pages 273-280, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. DFW96 Drew Dean, Edward W. Felten, and Dan S. Wallach. Java security: from Hot Java to netscape and beyond. In Proceedings of the IEEE Computer Society Symposium on Research in Security and Privacy, pages 190-200, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. ES90 M. Ellis and B. Stroustrup. The Annotated G++ Reference Manual. Addison-Wesley, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Jav96 JavaSoft. Innerclasses in Java 1.1. available from http:/{java.sun.com, 1996.Google ScholarGoogle Scholar
  8. KLM94 D. Katiyar, D. Luckham, and J.C. Mitchell. A type system for prototyping languages. In Proc. 21- st A CM Syrup. on Principles of Programming Languages, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. L+81 B. Liskov et al. GLU Reference Manual. Springer LNCS 114, Berlin, 1981. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. LBR96 Konstantin Lgufer, Gerald Baumgartner, and Vincent F. Russo. Safe structural conformance in java. Technical Report CSD-TR-96-077, Purdue University, December 1996.Google ScholarGoogle Scholar
  11. LSAS77 Barbara Liskov, Alan Snyder, Russell Atkinson, and Craig Schaffert. Abstraction mechanisms in CLU. Communications oj the A GM, 20(8):564-576, August 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. LY96 Tim Lindholm and Frank Yellin. The Java" Virtual Machine Specification. Addison-Wesley, 1996. ,' Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. MBL97 Andrew C. Myers, Joseph A. Bank, and Barbara Liskov. Parameterized types for Java. In Proe. 24th ACM SympOsium on Principles of Programming Lan. guages, pages 132-145, January 1997. Google ScholarGoogle Scholar
  14. Mil85 R. Milner. The Standard ML core language. Polymorphism, 2(2), 1985. 28 pages. An earlier version appeared in Proc. 1984 ACM Symp. on Lisp and Functional Programming.Google ScholarGoogle Scholar
  15. Mit96 J.O. Mitchell. Foundations }or Programming Languages. MIT Press, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. MS95 D.R. Musser and A. Saini. STL Tutorial and Reference Guide. Addison-Wesley, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. OW97a Martin Odersky and Philip Wadler. The Pizza compiler, available from http://www.math.luc.edu/pizza, February 1997.Google ScholarGoogle Scholar
  18. OW97b Martin Odersky and Philip Wadler. Pizza into Java: Translating theory into practice. In Proc. $4th AGM Symposium on Principles of Programming Languages, January 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. PSLM96 P. J. Plauger, A. A. Stepanov, M. Lee, and D. R. Musser. The Standard Template Library. Prentice- Hall, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Tho97 Kresten Krab Thorup. Genericity in Java with virtual types. In European Conference On Object Oriented Programming, 1997:Google ScholarGoogle Scholar
  21. Ull94 J.D. Ullman. Elements of ML programming. Prentice Hall, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. US 80 US Dept. of Defense. Reference Manual }or the Ada Programming Language. GPO 008-000-00354-8, 19813.Google ScholarGoogle Scholar

Index Terms

  1. Adding type parameterization to the Java language

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 32, Issue 10
        Oct. 1997
        344 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/263700
        Issue’s Table of Contents
        • cover image ACM Conferences
          OOPSLA '97: Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
          October 1997
          345 pages
          ISBN:0897919084
          DOI:10.1145/263698

        Copyright © 1997 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 9 October 1997

        Check for updates

        Qualifiers

        • article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader