Covariant specialization in Java

Gupta, Suchitra

Covariant specialization in Java

Covariant specialization is a form of multiple polymorphism supported by some object-oriented programming languages for overriding a method by varying its parameter types. Particularly useful in frameworks that support dynamic behavior, it is a convenient mechanism in a variety of situations. Although Java does not directly support covariant specialization, it is possible to achieve a similar effect without language extensions by employing Java's rich reflection capabilities while preserving runtime type safety and efficiency. It is shown how this can be done in Java, first providing a practical definition of covariant specialization, then describing the technique via sample code. Finally, applications of covariant specialization and issues encountered in implementing and applying the technique are presented.


GUIDELINES
CUSTOMIZATION
JAVA

H004.415 JOU