Interfaces with default implementations in Java
Markus Mohnen · 2002
With the interface construct, Java features a concept with high potential for producing reusable code: Java's interfaces allow the definition of class properties independently of class inheritance. We propose an extension of Java for providing default implementations in interfaces. Default implementations are useful since they reduce the effort required to implement an interface. They are especially interesting if there is a canonical way to implement methods of the interface in terms of some other methods. In these cases, an implementation can be obtained by implementing the base methods and use the default implementations of the other methods. We discuss the rationale for our design and show that the extension can be implemented both efficiently and conservatively, i.e. without modification of the Java virtual machine.
Cited by 17 works. doi:10.5555/638476.638484
Authors
References
- Design Patterns: Elements of Reusable Object-Oriented Software
- The Java Language Specification
- Report on the programming language Haskell
- The C++ Programming Language, 4th Edition
- Encapsulation and inheritance in object-oriented programming languages
- Pizza into Java
- Mixin-based inheritance
- Java Language Specification, Second Edition: The Java Series
- Making the future safe for the past
- Object-Oriented Programming in COMMON LISP: A Programmer's Guide to CLOS