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.

On access restriction with Java wildcards / Mirko Viroli; Giovanni Rimassa. - In: JOURNAL OF OBJECT TECHNOLOGY. - ISSN 1660-1769. - ELETTRONICO. - 4(10):(2005).

On access restriction with Java wildcards

VIROLI, MIRKO;
2005

Abstract

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.
2005
On access restriction with Java wildcards / Mirko Viroli; Giovanni Rimassa. - In: JOURNAL OF OBJECT TECHNOLOGY. - ISSN 1660-1769. - ELETTRONICO. - 4(10):(2005).
Mirko Viroli; Giovanni Rimassa
File in questo prodotto:
Eventuali allegati, non sono esposti

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11585/23001
 Attenzione

Attenzione! I dati visualizzati non sono stati sottoposti a validazione da parte dell'ateneo

Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 6
  • ???jsp.display-item.citation.isi??? ND
social impact