Morphing: Safely shaping a class in the image of others

16Citations
Citations of this article
10Readers
Mendeley users who have this article in their library.
Get full text

Abstract

We present MJ: a language for specifying general classes whose members are produced by iterating over members of other classes. We call this technique "class morphing" or just "morphing". Morphing extends the notion of genericity so that not only types of methods and fields, but also the structure of a class can vary according to type variables. This offers the ability to express common programming patterns in a highly generic way that is otherwise not supported by conventional techniques. For instance, morphing lets us write generic proxies (i.e., classes that can be parameterized with another class and export the same public methods as that class); default implementations (e.g., a generic do-nothing type, configurable for any interface); semantic extensions (e.g., specialized behavior for methods that declare a certain annotation); and more. MJ's hallmark feature is that, despite its emphasis on generality, it allows modular type checking: an MJ class can be checked independently of its uses. Thus, the possibility of supplying a type parameter that will lead to invalid code is detected early - an invaluable feature for highly general components that will be statically instantiated by other programmers. © Springer-Verlag Berlin Heidelberg 2007.

Cite

CITATION STYLE

APA

Huang, S. S., Zook, D., & Smaragdakis, Y. (2007). Morphing: Safely shaping a class in the image of others. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 4609 LNCS, pp. 399–424). Springer Verlag. https://doi.org/10.1007/978-3-540-73589-2_19

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free