POPL '90 Proceedings of the 17th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Theoretical aspects of object-oriented programming: types, semantics, and language design
Theoretical aspects of object-oriented programming: types, semantics, and language design
A Theory of Objects
PolyTOIL: A type-safe polymorphic object-oriented language
ACM Transactions on Programming Languages and Systems (TOPLAS)
Hi-index | 0.00 |
The impact of contravariant methods (and/or binary methods) on the relationship between object subtyping and inheritance has been extensively studied, in theory, in the research of object-oriented programming (OOP). It has been found that subtyping induced by inheritance is not sound when contravariant methods (andor binary methods) are present in objects. Unfortunately, in the practice of OOP, it seems that this important discovery in OOP theory has not been taken into account to improve the programming activities. As a result, strange and ad hoc computations can occur when contravariant methods are involved in programming. In this short paper, we first describe the contravariant methods problem using ζ-calculus. Then, we show how this problem is handled in practice by presenting the corresponding Java code and C++ code of the problem. Finally, through a comparison between the theory and practice of OOP, we would like to point out that fundamental bugs exist in the way in which inheritance, subtyping, and dynamic binding are dealt with in Java and C++; that more theoretical work needs to be done to precisely describe the relationship between inheritance and subtyping; and that corrections and improvements in OOP practice, under the guidance of OOP theory, need to be implemented properly.