![]() Home | DMP | Project | Journal | Contact Relevant Java Classes | Delete Call Site | Template Call Graph | Research | Final Report Previous (Type Classification) Next (Type Inference Algorithms and Call Graph Construction)
Polymorphism is one of the most important features of object-oriented languages. It can be easily described in terms of abstract and concrete types; Agesen defines it as the ability of code to work on objects of different concrete types, as long as the abstract type required by the code is satisfied. For example, instances of "As a rule of thumb, you should be thinking about the interfaces rather than the implementations...For the most part, the choice of implementation affects only performance. The preferred style...is to choose an implementation when a collection is created, and immediately assign the new collection to a variable of the corresponding interface type (or pass the collection to a method expecting an argument of the interface type). In this way, the program does not become dependent on any added methods in a given implementation, leaving the programmer or maintainer with the freedom to change implementations at the drop of a hat."Polymorphism is often used in this capacity in Java (and, I would assume, in most other object-oriented languages), with the FLEX source files providing many examples. Despite its benefits - flexiblity and expressiveness - polymorphism can become quite a challenge for type inference, especially with a concrete and specific system. Agesen's Cartesian product algorithm described in the following section directly tackles many of the problems presented by parametric polymorphism, the ability of a method to be invoked with arguments (including the receiver) of multiple concrete types.
Home | DMP | Project | Journal | Contact Relevant Java Classes | Delete Call Site | Template Call Graph | Research | Final Report Previous (Type Classification) Next (Type Inference Algorithms and Call Graph Construction) ©2002, Katie Heise |