skip to main content
10.1145/1529282.1529702acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

Symmetric encapsulated multi-methods to abstract over application structure

Published:08 March 2009Publication History

ABSTRACT

In object systems, classes take the role of modules, and interfaces consist of methods. Because methods are encapsulated in objects, interfaces in object systems do not allow abstracting over where methods are implemented. This implies that any change to the implementation structure may cause a rippling effect. Sometimes this unduly restricts the scope of software evolution, in particular for methods with multiple parameters where there is no clear owner. We propose a simple scheme where symmetric methods may be defined in the classes of any of their parameters. This allows client code to be oblivious of what class contains a method implementation, and therefore immune against it changing. When combined with multiple dynamic dispatch, this scheme allows for modular extensibility (but not modular type-checking) where a method defined in one class is overridden by a method defined in a class that is not its subtype. In this paper, we illustrate the scheme by extending a core calculus of class-based languages with these symmetric encapsulated multi-methods, and prove the result sound.

References

  1. Allen, Chase, Hallett, Luchangco, Maessen, Ryu, Steele, and Tobin-Hochstadt. The Fortress Language Specification. Version 1.0. Sun Microsystems, 2008.Google ScholarGoogle Scholar
  2. E. Allen, J. J. Hallett, V. Luchangco, S. Ryu, and J. Guy L. Steele. Modular multiple dispatch with multiple inheritance. In SAC '07: Proceedings of the 2007 ACM symposium on Applied computing, pages 1117--1121, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. D. G. Bobrow, L. G. DeMichiel, R. P. Gabriel, S. E. Keene, G. Kiczales, and D. A. Moon. Common lisp object system specification. SIGPLAN Not., 23(SI):1--142, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. F. Bourdoncle and S. Merz. Type checking higher-order polymorphic multi-methods. In POPL '97: Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 302--315, New York, NY, USA, 1997. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. Boyland and G. Castagna. Parasitic methods: an implementation of multi-methods for java. In OOPSLA '97: Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 66--76, New York, NY, USA, 1997. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. K. Bruce, L. Cardelli, G. Castagna, G. T. Leavens, and B. Pierce. On binary methods. Theor. Pract. Object Syst., 1(3):221--242, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Castagna. Covariance and contravariance: conflict without a cause. ACM Trans. Program. Lang. Syst., 17(3):431--447, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Castagna, G. Ghelli, and G. Longo. A calculus for overloaded functions with subtyping. Information and Computation, 117(1):115--135, 15 Feb. 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. C. Clifton, T. Millstein, G. T. Leavens, and C. Chambers. Multijava: Design rationale, compiler implementation, and applications. ACM Trans. Program. Lang. Syst., 28(3):517--575, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. B. Foote, R. E. Johnson, and J. Noble. Efficient multimethods in a single dispatch language. In ECOOP, pages 337--361, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. C. Frost and T. Millstein. Modularly typesafe interface dispatch in jpred. In The 2006 International Workshop on Foundations and Developments of Object-Oriented Languages (FOOL/WOOD '06), January 2006.Google ScholarGoogle Scholar
  12. W. Harrison, D. Lievens, and T. Walsh. Continuum/j language specification. Technical report, Trinity College Dublin, 2008.Google ScholarGoogle Scholar
  13. W. Harrison and H. Ossher. Subject-oriented programming: a critique of pure objects. SIGPLAN Not., 28(10):411--428, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Igarashi, B. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. TOPLAS, 23(3):396--459, May 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Lievens and W. Harrison. Symmetric encapsulated multi-methods. Technical report, Trinity College Dublin, 2008.Google ScholarGoogle Scholar
  16. T. Millstein, M. Reay, and C. Chambers. Relaxed multijava: balancing extensibility and modular typechecking. In OOPSLA '03: Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, pages 224--240, New York, NY, USA, 2003. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. T. D. Millstein and C. Chambers. Modular statically typed multimethods. In ECOOP '99: Proceedings of the 13th European Conference on Object-Oriented Programming, pages 279--303, London, UK, 1999. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. L. Parnas. On the criteria to be used in decomposing systems into modules. Commun. ACM, 15(12):1053--1058, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. P. Pirkelbauer, Y. Solodkyy, and B. Stroustrup. Open multi-methods for c++. In GPCE '07: Proceedings of the 6th international conference on Generative programming and component engineering, pages 123--134, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Symmetric encapsulated multi-methods to abstract over application structure

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            SAC '09: Proceedings of the 2009 ACM symposium on Applied Computing
            March 2009
            2347 pages
            ISBN:9781605581668
            DOI:10.1145/1529282

            Copyright © 2009 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 8 March 2009

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Acceptance Rates

            Overall Acceptance Rate1,650of6,669submissions,25%

            Upcoming Conference

            SAC '24

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader