On Access Restriction with Java']Java Wildcards

被引:0
作者
Viroli, Mirko [1 ]
Rimassa, Giovanni [2 ]
机构
[1] Alma Mater Studiorum Univ Bologna, DEIS, Bologna, Italy
[2] Whitestein Technol AG, Zurich, Switzerland
来源
JOURNAL OF OBJECT TECHNOLOGY | 2005年 / 4卷 / 10期
关键词
D O I
暂无
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Java wildcards is a new programming mechanism shipped with the Java 5.0 release, introduced to provide a flexible subtyping mechanism for generic types. Safety is retained by providing rather peculiar and non-trivial mechanisms to restrict access to a class functionalities (methods and fields), which are currently not deeply described in the Java Language Specification. In this paper we develop on the theory of variant parametric types from which wildcards originated, and study a framework to describe these access restriction issues in detail, promoting the understanding and fruitful exploitation of this new programming concept. Our work is both technical and conceptual. On the one hand, we provide an abstract characterisation of formal rules to access restriction, then instantiated to the particular implementation of wildcards in current Java. On the other hand, we show that such a characterisation induces a natural description and understanding of access restriction in terms of the ability of (instances of) a generic class to produce/consume elements of the abstracted type.
引用
收藏
页数:23
相关论文
共 14 条
[1]   Making the future safe for the past:: Adding genericity to the Java']Java™ programming language [J].
Bracha, G ;
Odersky, M ;
Stoutamire, D ;
Wadler, P .
ACM SIGPLAN NOTICES, 1998, 33 (10) :183-200
[2]  
Canning Peter, 1989, P 4 INT C FUNCTIONAL, P8
[3]   ON UNDERSTANDING TYPES, DATA ABSTRACTION, AND POLYMORPHISM. [J].
Cardelli, Luca ;
Wegner, Peter .
Computing surveys, 1985, 17 (04) :471-522
[4]  
Coplien J.O., 1999, MULTIPARADIGM DESIGN
[5]  
DAY M, 1995, SIGPLAN NOTICES, V30, P156, DOI 10.1145/217839.217852
[6]  
Igarashi A, 2002, LECT NOTES COMPUT SC, V2374, P441
[7]   Featherweight Java']Java: A minimal core calculus for Java']Java and GJ [J].
Igarashi, A ;
Pierce, BC ;
Wadler, P .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2001, 23 (03) :396-450
[8]  
JOY B, 2005, JAVA LANGUAGE SPECIF
[9]  
LISKOV B, 1988, SIGPLAN NOTICES, V23, P17, DOI 10.1145/62139.62141
[10]  
MEYER B, 1986, SIGPLAN NOTICES, V21, P391, DOI 10.1145/960112.28738