Safe Structural Conformance for Java

9 years 11 months ago
Safe Structural Conformance for Java
In Java, an interface specifies public abstract methods and associated public constants. Conformance of a class to an interface is by name. We propose to allow structural conformance to interfaces: Any class or interface that declares or implements each method in a target interface conforms structurally to the interface, and any expression of the source class or interface type can be used where a value of the target interface type is expected. We argue that structural conresults in a major gain in flexibility in situations that require retroactive abstraction over types. Structural conformance requires no additional syntax and only small modifications to the Java compiler and optionally, for performance reasons, the virtual machine, resulting in a minor performance penalty. Our extension is type-safe: A cast-free program that compiles without errors will not have any type errors at run time. Our extension is conservative: Existing Java programs still compile and run in the same manner...
Konstantin Läufer, Gerald Baumgartner, Vincen
Added 17 Dec 2010
Updated 17 Dec 2010
Type Journal
Year 2000
Where CJ
Authors Konstantin Läufer, Gerald Baumgartner, Vincent F. Russo
Comments (0)