Loading...
Please wait, while we are loading the content...
Similar Documents
Parasitic Methods: An Implementation of Multi-Methods for Java (1997)
| Content Provider | CiteSeerX |
|---|---|
| Author | Boyland, John Castagna, Giuseppe |
| Description | In an object-oriented programming language, method selection is (usually) done at run-time using the class of the receiver. Some object-oriented languages (such as CLOS) have multi-methods which comprise several methods selected on the basis of the run-time classes of all the parameters, not just the receiver. Multi-methods permit intuitive and typesafe definition of binary methods such as structural equality, set inclusion and matrix multiplication, just to name a few. Java as currently defined does not support multimethods. This paper defines a simple extension to Java that enables the writing of "encapsulated" multi-methods through the use of parasitic methods, methods that "attach" themselves to other methods. Encapsulated multi-methods avoid some of the modularity problems that arise with fully general multi-methods. Furthermore, this extension yields for free both covariant and contravariant specialization of methods (besides Java's current invariant specialization). Programs using this extension can be translated automatically at the source level into programs that do not; they are modular, type-safe, and allow separate compilation. |
| File Format | |
| Language | English |
| Publisher | ACM |
| Publisher Date | 1997-01-01 |
| Access Restriction | Open |
| Subject Keyword | Typesafe Definition Simple Extension Run-time Class Extension Yield Contravariant Specialization Structural Equality Current Invariant Specialization Object-oriented Language Several Method Source Level Object-oriented Programming Language Parasitic Method General Multi-methods Method Selection Binary Method Modularity Problem Matrix Multiplication Separate Compilation |
| Content Type | Text |
| Resource Type | Article |