Adding type parameterization to the Java']Java(TM) language

被引:18
作者
Agesen, O [1 ]
Freund, SN [1 ]
Mitchell, JC [1 ]
机构
[1] STANFORD UNIV,DEPT COMP SCI,STANFORD,CA 94305
关键词
D O I
10.1145/263700.263720
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:49 / 65
页数:17
相关论文
共 21 条
[1]  
Arnold Ken., 1996, The Java Programming Language
[2]  
Canning Peter., 1989, PROC 4 INT C FUNCTIO, P273
[3]   COVARIANCE AND CONTRAVARIANCE - CONFLICT WITHOUT A CAUSE [J].
CASTAGNA, G .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1995, 17 (03) :431-447
[4]   Java']Java security: From HotJava']Java to netscape and beyond [J].
Dean, D ;
Felten, EW ;
Wallach, DS .
1996 IEEE SYMPOSIUM ON SECURITY AND PRIVACY, PROCEEDINGS, 1996, :190-200
[5]  
ELLIS M, 1990, ANNOTATE C REFERENCE
[6]  
KATIYAR D, 1994, P 21 ACM S PRINC PRO
[7]  
LAUFER K, 1996, CSDTR96077 PURD U
[8]  
LINDHOLM T, 1996, JAVA VIRTUAL MACHINE
[9]   ABSTRACTION MECHANISMS IN CLU [J].
LISKOV, B ;
SNYDER, A ;
ATKINSON, R ;
SCHAFFERT, C .
COMMUNICATIONS OF THE ACM, 1977, 20 (08) :564-576
[10]  
LISKOV B, 1981, CLU REFERENCE MANUAL, V114