Type-checking OQL queries in the ODMG type systems

Several negative results are proved about the ability to type-check queries in the only existing proposed standard for object-oriented databases. The first of these negative results is that it is not possible to type-check OQL queries in the type system underlying the ODMG object model and its definition language ODL. The second negative result is that OQL queries cannot be type-checked in the type system of the Java binding of the ODMG standard either. A solution proposed in this paper is to extend the ODMG object model with explicit support for parametric polymorphism (universal type quantification). These results show that Java cannot be a viable database programming language unless extended with parametric polymorphism. This is why type-checking OQL queries presents no problem for the type system of the C++ binding of the ODMG standard. However, a type system that is strictly more powerful than any of the type systems of the ODMG standard is required in order to properly type ordered collectgions and indices. The required form of polymorphism is bounded type quantification (constrained genericity) and even F-bounded polymorphism. A further result is that neither static nor the standard dynamic object-oriented type-checking is possible for Java OQL, in spite of the fact that Java OQL combines features of two strongly and mostly statically-typed languages. Contrary to one of the promises of object-oriented database technology, this result shows that the impedance mismatch does not disappear in the ODMG standard. A type-safe reflective technique is proposed for overcoming this mismatch.

[1]  David Jordan,et al.  The Object Database Standard: ODMG 2.0 , 1997 .

[2]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[3]  François Bancilhon,et al.  The O2 object-oriented database system , 1992, SIGMOD '92.

[4]  Sophia Drossopoulou,et al.  Java is Type Safe - Probably , 1997, ECOOP.

[5]  Suad Alagic,et al.  Parametric polymorphism for Java: a reflective solution , 1998, OOPSLA '98.

[6]  Kim B. Bruce,et al.  PolyTOIL: A Type-Safe Polymorphic Object-Oriented Language , 1995, ECOOP.

[7]  Suad Alagic F-Bounded Polymorphism for Database Programming Languages , 1994, East/West Database Workshop.

[8]  Bjarne Stroustrup,et al.  The C++ programming language (2nd ed.) , 1991 .

[9]  Martín Abadi,et al.  On subtyping and matching , 1995, TOPL.

[10]  William R. Cook,et al.  Inheritance is not subtyping , 1989, POPL '90.

[11]  Martin Odersky,et al.  Making the future safe for the past: adding genericity to the Java programming language , 1998, OOPSLA '98.

[12]  Richard C. H. Connor,et al.  Type-Safe Linguistic Reflection: A Generator Technology , 2000 .

[13]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[14]  Benjamin C. Pierce,et al.  Bounded quantification is undecidable , 1992, POPL '92.

[15]  Richard Cooper,et al.  Type-Safe Linguistic Run-time Reflection - A Practical Perspective , 1994, POS.

[16]  Peter Buneman,et al.  Polymorphism and type inference in database programming , 1996, TODS.

[17]  Suad Alagic,et al.  The ODMG object model: does it make sense? , 1997, OOPSLA '97.

[18]  Suad Alagic O2 and The ODMG Standard: Do They Match? , 1999, Theory Pract. Object Syst..

[19]  John C. Mitchell,et al.  F-bounded polymorphism for object-oriented programming , 1989, FPCA.

[20]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[21]  David W. Stemple,et al.  Exceeding the Limits of Polymorphism in Database Programming Languages , 1990, EDBT.

[22]  Stephen N. Freund,et al.  Adding type parameterization to the Java language , 1997, OOPSLA '97.

[23]  Ronald Morrison,et al.  Persistent First Class Procedures are Enough , 1984, FSTTCS.

[24]  Suad Alagic Constrained Matching is Type Safe , 1997, DBPL.

[25]  William R. Cook,et al.  A Proposal for Making Eiffel Type-Safe , 1989, Comput. J..

[26]  Martin Odersky,et al.  Pizza into Java: translating theory into practice , 1997, POPL '97.

[27]  Suad Alagic,et al.  Orthogonal to the Java Imperative , 1998, ECOOP.

[28]  Kim B. Bruce,et al.  Safe and decidable type checking in an object-oriented language , 1993, OOPSLA '93.

[29]  Peter Buneman,et al.  Database programming in Machiavelli—a polymorphic language with static type inference , 1989, SIGMOD '89.

[30]  Luca Cardelli,et al.  Types for Data-Oriented Languages , 1988, EDBT.

[31]  François Bancilhon,et al.  Building an Object-Oriented Database System, The Story of O2 , 1992 .

[32]  Peter Buneman,et al.  Static type inference for parametric classes , 1989, OOPSLA 1989.

[33]  Peter Buneman,et al.  Static type inference for parametric classes , 1989, OOPSLA '89.

[34]  David J. DeWitt,et al.  The Object-Oriented Database System Manifesto , 1994, Building an Object-Oriented Database System, The Story of O2.