skip to main content
10.1145/2162049.2162065acmconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
research-article

Method shelters: avoiding conflicts among class extensions caused by local rebinding

Published: 25 March 2012 Publication History

Abstract

A class extension, also known as open classes, allows programmers to modify existing classes and thus it is supported by several programming languages. However, class extensions imply a risk that they supply different definitions for the same method and those definitions conflict with each other. Several module systems have been proposed to address these conflicts. One approach lexically restricts the scope of class extensions but they do not allow us to change the behavior of methods called indirectly. Another approach is to make only class extensions explicitly imported effective while preserving the local rebinding property, which allows us to change the behavior of indirectly called methods. However, this approach causes conflicts if potentially conflicting class extensions are imported together. To address this problem, we propose a new module system named method shelters. A method shelter confines a scope of class extensions while preserving the local rebinding property. Hidden class extensions in a method shelter are not visible from the outside. We implemented a prototype of the proposed module system in Ruby. This paper illustrates several examples of the use of method shelters and also shows the results of benchmarks on our prototype.

References

[1]
J. Aldrich. Open modules: Modular reasoning about advice. In ECOOP '05, pages 144--168, 2005.
[2]
A. Bergel, S. Ducasse, and O. Nierstrasz. Classbox/j: controlling the scope of change in java. In OOPSLA '05, pages 177--189. ACM, 2005.
[3]
A. Bergel, S. Ducasse, O. Nierstrasz, and R. Wuyts. Classboxes: Controlling visibility of class extensions. In phComputer Languages, Systems and Structures, 2005.
[4]
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: 1--142, September 1988.
[5]
G. Bracha and W. Cook. Mixin-based inheritance. In OOPSLA/ECOOP '90, pages 303--311. ACM, 1990.
[6]
S. Chiba, A. Igarashi, and S. Zakirov. Mostly modular compilation of crosscutting concerns by contextual predicate dispatch. In OOPSLA '10, pages 539--554. ACM, 2010.
[7]
D. Crockford. The application/json Media Type for JavaScript Object Notation (JSON). RFC 4627 (Informational), July 2006. URL http://www.ietf.org/rfc/rfc4627.txt.
[8]
A. Goldberg and D. Robson. Smalltalk-80: the language and its implementation. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1983.
[9]
R. Hirschfeld, P. Costanza, and O. Nierstrasz. Context-oriented programming. Journal of Object Technology, 7 (3): 125--151, March-April 2008.
[10]
G. Kiczales, E. Hilsdale, J. Hugunin, M. Kersten, J. Palm, and W. G. Griswold. An overview of aspectj. In ECOOP '01, pages 327--353. Springer-Verlag, 2001.
[11]
T. Millstein, M. Reay, and C. Chambers. Relaxed multijava: balancing extensibility and modular typechecking. In OOPSLA '03, pages 224--240. ACM, 2003.
[12]
N. Ongkingco, P. Avgustinov, J. Tibble, L. Hendren, O. de Moor, and G. Sittampalam. Adding open modules to aspectj. In AOSD '06, pages 39--50. ACM, 2006.
[13]
Rails core team. Ruby on rails. http://rubyonrails.org/, 2011.
[14]
Ruby community. Ruby programming language. http://www.ruby-lang.org/, 2011.
[15]
Diary.org. tDiary. http://sourceforge.net/projects/tdiary/, 2011.
[16]
P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In POPL '89, pages 60--76. ACM, 1989.
[17]
A. Wirfs-Brock and B. Wilkerson. A overview of modular smalltalk. In OOPSLA '88, pages 123--134. ACM, 1988.

Cited By

View all

Index Terms

  1. Method shelters: avoiding conflicts among class extensions caused by local rebinding

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    AOSD '12: Proceedings of the 11th annual international conference on Aspect-oriented Software Development
    March 2012
    286 pages
    ISBN:9781450310925
    DOI:10.1145/2162049
    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]

    Sponsors

    In-Cooperation

    • AOSA: Aspect-Oriented Software Association

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 25 March 2012

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. class extension
    2. module
    3. open class

    Qualifiers

    • Research-article

    Conference

    AOSD '12
    AOSD '12: Aspect-oriented Software Development
    March 25 - 30, 2012
    Potsdam, Germany

    Acceptance Rates

    AOSD '12 Paper Acceptance Rate 20 of 79 submissions, 25%;
    Overall Acceptance Rate 41 of 139 submissions, 29%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)1
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 06 Nov 2024

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media