This paper is addressing three major and quite controversial issues critical for the next generation of virtual platforms for object-oriented languages. The first one is providing explicit support for parametric types in the virtual machine. Lack of proper support in the Java Virtual Machine is precisely the reason for violations in Java 5.0 with respect to dynamic type checking, correctness of run-time type information, and correctness of persistence and reflective capabilities. The second limitation of current object oriented languages and their virtual platforms is proper support for assertions (constraints). Contrary to customary views on assertions, we show that object-oriented languages (of the next generation) equipped with assertions and running on virtual platforms require proper support for these high-level features in the virtual machine. Parametric types equipped with assertions (constraints) should play a significant role in applications such as database systems, but the current virtual platforms have very inadequate support for persistence. We argue for much more sophisticated orthogonal persistent capabilities, where orthogonality is also a point of controversy. The main components of the required architecture are presented in the paper. This architecture includes representation of parametric types and logic-based constraints in class file and class object structures, a loader that performs appropriate actions on type parameters and constraints, and reflective capabilities that report information on type signatures and their associated constraints. A particularly surprising component of this architecture, not considered as a part of a virtual platform, is an interface with a program verification system that performs checking of constraints and verifies behavioral subtyping requirements. This is accomplished by interfacing the program verification system with reflective capabilities and performing verification by accessing type signatures and their associated constraints in (dynamically) loaded class objects. The specifics are elaborated in the paper and implemented by extending the Java Virtual Machine with the proposed functionalities. 1. EXTENDED VIRTUAL PLATFORMS The core idea of this paper is that virtual platforms, for object-oriented languages, with parametric types and logicbased constraints (assertions) must provide proper support for these high-level language features. Lack of proper support for parametric types has major implications for correctness of static and dynamic type checking, correctness of run-time type information, and correctness of persistence and reflective capabilities of virtual platforms [18, 36]. This point of view comes as a surprise after years of research and experience with languages such as C++ which indicated that parametric polymorphism can and should be handled completely statically. Hence, no support in the virtual machine should be required. But we show that lack of proper support in the Java Virtual Machine is precisely the reason for all of the above anomalies in Java 5.0. These surprisingly severe implications have been properly understood by the designers of the C# extension with parametric polymorphism [25]. Unlike the JVM, Common Language Runtime [37] has been extended with a variety of features ensuring proper support for parametric polymorphism. Almost complete lack of assertions in mainstream objectoriented languages such as Java (Eiffel [31] is an exception) is also regarded as a major limitation. But providing support for assertions comes with considerable more subtleties. Assertions (constraints) are logic-based, declarative, and hence a high-level language feature that seemingly does not require support in the underlying virtual machine. But just like with parametric types, we show that for languages running on virtual platforms this perfectly natural point of view does not hold any more. The view that virtual platforms for object-oriented languages should provide proper support for the management of constraints is new and much more subtle. We show that lack of proper support for constraints has non-trivial implications on integrating constraints into the overall environment and managing them in their declarative form. Lack of proper support for constraints makes it impossible for reflective capabilities of a virtual platform to report information on constraints along with types, and on the ability to verify behavioral subtyping requirements. A major subtlety in languages on virtual platforms is that the source code may not be available. Hence, verifying behavioral subtyping requires access to a suitable representation of constraints in class files and class objects. Because of dynamic loading these conditions must often be verified dynamically where static verification becomes a particular case. Of course, loading all class objects and performing effectively static verification is a preferable mode of operation in the proposed extended platform as well, especially if an interactive program verification system is used. Parametric classes along with constraints are typically required in typed persistent and database systems because of various types of collections equipped with data integrity constraints. But the current most popular virtual platforms for object-oriented languages, the Java Virtual Machine in particular, have very inadequate support for persistence. This has led to a variety of specialized virtual machines that have those capabilities. We argue that much more sophisticated persistent capabilities are required in the next generation of virtual platforms. Whether those will in fact support orthogonal persistence is yet another point of controversy. File System Class file Loader PVS System Class Object Read Class Create Class Object PVS Response Create PVS Theories
[1]
Suad Alagic,et al.
Orthogonal to the Java Imperative
,
1998,
ECOOP.
[2]
R. Venkatesh,et al.
Persistent Java Objects in 3 Tier Architectures
,
1998,
POS/PJW.
[3]
Malcolm P. Atkinson,et al.
Orthogonal Persistence for Java? - A Mid-term Report
,
1998,
POS/PJW.
[4]
Suad Alagic,et al.
Parametric polymorphism for Java: a reflective solution
,
1998,
OOPSLA '98.
[5]
Jeannette M. Wing,et al.
A behavioral notion of subtyping
,
1994,
TOPL.
[6]
Suad Alagic,et al.
Parametric polymorphism for Java: is there any hope in sight?
,
2004,
SIGP.
[7]
Andrew C. Myers,et al.
Parameterized types for Java
,
1997,
POPL '97.
[8]
簡聰富,et al.
物件導向軟體之架構(Object-Oriented Software Construction)探討
,
1989
.
[9]
Gary T. Leavens,et al.
Concepts of behavioral subtyping and a sketch of their extension to component-based systems
,
2000
.
[10]
Suad Alagic,et al.
Consistency of Java Transactions
,
2003,
DBPL.
[11]
Amir Pnueli,et al.
TLPVS: A PVS-Based LTL Verification System
,
2003,
Verification: Theory and Practice.
[12]
Malcolm P. Atkinson,et al.
An orthogonally persistent Java
,
1996,
SGMD.
[13]
Suad Alagic,et al.
Parametric Polymorphism and Orthogonal Persistence
,
2000,
Objects and Databases.
[14]
Hendrik Tews,et al.
Reasoning about Java Classes (Preliminary Report)
,
1998,
Conference on Object-Oriented Programming Systems, Languages, and Applications.
[15]
Andrew Kennedy,et al.
Design and implementation of generics for the .NET Common language runtime
,
2001,
PLDI '01.
[16]
Pierre America,et al.
Designing an Object-Oriented Programming Language with Behavioural Subtyping
,
1990,
REX Workshop.
[17]
Gary T. Leavens,et al.
Safely creating correct subclasses without seeing superclass code
,
2000,
OOPSLA.
[18]
Martin Odersky,et al.
Making the future safe for the past: adding genericity to the Java programming language
,
1998,
OOPSLA '98.
[19]
Bertrand Meyer,et al.
Eiffel: The Language
,
1991
.
[20]
Gary T. Leavens,et al.
Design by Contract with JML
,
2006
.
[21]
Frank Yellin,et al.
The java virtual machine
,
1996
.
[22]
Véronique Benzaken,et al.
Static Integrity Constraint Management in Object-Oriented Database Programming Languages via Predicate Transformers
,
1997,
ECOOP.
[23]
Suad Alagic,et al.
The ODMG object model: does it make sense?
,
1997,
OOPSLA '97.
[24]
Suad Alagic,et al.
Behavioral Compatibility of Self-Typed Theories
,
2002,
ECOOP.
[25]
Suad Alagic.
Temporal Object-Oriented Programming
,
2000,
Comput. J..
[26]
Mark Lillibridge,et al.
Extended static checking for Java
,
2002,
PLDI '02.
[27]
Stephen N. Freund,et al.
Adding type parameterization to the Java language
,
1997,
OOPSLA '97.
[28]
David J. DeWitt,et al.
The Object-Oriented Database System Manifesto
,
1994,
Building an Object-Oriented Database System, The Story of O2.
[29]
Ronald Morrison,et al.
Orthogonally persistent object systems
,
1995,
The VLDB Journal.