Advertisement

Metaphoric polymorphism: Taking code reuse one step further

  • Ran Rinat
  • Menachem Magidor
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1098)

Abstract

We propose two new constructs for object oriented programming that significantly increase polymorphism. Consequently, code may be reused in ways unaccounted for by existing machinery. These constructs of type correspondence and partial inheritance are motivated from metaphors of natural language and thought. They establish correspondences between types non of which is (necessarily) a subtype of the other. As a result, methods may operate on objects — and may receive arguments — of types different than the ones originally intended for. The semantics of the proposed constructs generalizes that of ordinary inheritance, thereby establishing the latter as a special case. We show that the incorporation of these constructs in programming supports the process of natural software evolution and contributes to a better conceptual organization of the type system.

Keywords

Class Hierarchy Type Correctness Correspondence Relation Class Matrix Code Reuse 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    R.M. Amadio and L. Cardelli. Subtyping recursive types. ACM Transactions on Programming Languages and Systems, 15(4), 1993.Google Scholar
  2. 2.
    G. Booch. Object-Oriented Analysis and Design with Applications. The Benjamin/Cummings Publishing Company, Inc, 1994.Google Scholar
  3. 3.
    E.R. Cook, W.L Hill, and P.S. Canning. Inheritance is not subtyping. In C.A. Gunter and J.C Mitchell, editors, Theoretical Aspects of Object-Oriented Programming. The MIT Press, 1994.Google Scholar
  4. 4.
    W.R. Cook. A proposal for making eiffel type-safe. The Computer Journal, 32(4), 1989.Google Scholar
  5. 5.
    P. Johnson and C. Rees. Reusability through fine-grain inheritance. Software-Pratice and Experience, 22(12), December 1992.Google Scholar
  6. 6.
    G. Lakoff. Women, Fire and Dangerous Things: What Categories Reveal About the Mind. The University of Chicago Press, 1987.Google Scholar
  7. 7.
    G. Lakoff and M. Johnson. Metaphors We Live By. The University of Chicago Press, 1980.Google Scholar
  8. 8.
    B. Meyer. Eiffel, the Language. Prentice Hall, 1992.Google Scholar
  9. 9.
    B. Meyer. Beware of polymorphic catcalls. Personal research note, http://www.eiffel.com/doc/manuals/technology/typing/cat.html, 1995.Google Scholar
  10. 10.
    R. Mitchell, J. Howse, and I. Maung. As-a: a relationship to support code reuse. Journal of Object-Oriented Programming, 8(4), July/August 1995.Google Scholar
  11. 11.
    J. Palsberg and M.I. Schwartzbach. Object-Oriented Type Systems. John Wiley & Sons, 1994.Google Scholar
  12. 12.
    J. Palsberg and M.I. Schwartzbach. Type substitution for object oriented programming. In OOPSLA/ECOOP '90 conference proceedings, ACM SIGPLAN Notices, Volume 25, Number 10, October 1990.Google Scholar
  13. 13.
    H. Pedersen. Extending ordinary inheritance schemes to include generalization. In OOPSLA '89 conference proceedings, ACM SIGPLAN Notices, 1989.Google Scholar
  14. 14.
    J. Rumbaugh. Dishinerited! examples of misuse of inheritance. Journal of Object-Oriented Programming, 5, February 1993.Google Scholar
  15. 15.
    J. Rumbaugh, M. Blaha, W. Premerlani, F. Eddy, and W. Lorenson. Object-Oriented Modeling and Design. Prentice Hall, 1991.Google Scholar
  16. 16.
    R. Stata and J. Guttag. Modular reasoning in th presence of subclassing. In OOPSLA '95 conference proceedings, ACM SIGPLAN Notices, Volume 30, Number 10, October 1995.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Ran Rinat
    • 1
  • Menachem Magidor
    • 2
  1. 1.Institute of Computer ScienceHebrew UniversityJerusalemIsrael
  2. 2.Institute of MathematicsHebrew UniversityJerusalemIsrael

Personalised recommendations