skip to main content
10.1145/2892664.2892682acmotherconferencesArticle/Chapter ViewAbstractPublication PagesmodularityConference Proceedingsconference-collections
research-article

Hierarchical layer-based class extensions in Squeak/Smalltalk

Published: 14 March 2016 Publication History

Abstract

Class extensions are frequently used in programming languages such as Ruby and Smalltalk to add or change methods of a class that is defined in the same application or in a different one. They suffer from modularity issues if globally visible: Other applications using the same classes are then affected by the modifications. This paper presents a hierarchical approach for dynamically scoping class extensions in dynamically-typed, class-based programming languages supporting class nesting. Our mechanism allows programmers to define the scope of class extensions and to reuse class extensions in other programs. Class extensions can be scoped according to a nested class hierarchy or based on whether programmers regard a potentially affected class as a black box or not. Class extensions are organized in layers, where multiple layers targeting the same class can be active at the same time.

References

[1]
Alexandre Bergel, Stéphane Ducasse, Oscar Nierstrasz, and Roel Wuyts. Classboxes: Controlling Visibility of Class Extensions. Computer Languages, Systems and Structures, November 2005.
[2]
Joshua Bloch. Effective Java (The Java Series). Prentice Hall PTR, Upper Saddle River, NJ, USA, 2 edition, 2008.
[3]
Gilad Bracha and William Cook. Mixin-based Inheritance. In Proceedings of the European Conference on Object-oriented Programming on Object-oriented Programming Systems, Languages, and Applications, OOPSLA/ECOOP ’90, pages 303–311, New York, NY, USA, 1990. ACM.
[4]
Curtis Clifton, Gary T. Leavens, Craig Chambers, and Todd Millstein. MultiJava: Modular Open Classes and Symmetric Multiple Dispatch for Java. In Proceedings of the 15th ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications, OOPSLA ’00, pages 130–145, New York, NY, USA, 2000. ACM.
[5]
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley Longman Publishing Co., Inc., 1995.
[6]
Robert Hirschfeld, Pascal Costanza, and Michael Haupt. An Introduction to Context-Oriented Programming with ContextS. In Generative and Transformational Techniques in Software Engineering II, volume 5235 of Lecture Notes in Computer Science, pages 396–407. Springer Berlin Heidelberg, 2008.
[7]
Robert Hirschfeld, Pascal Costanza, and Oscar Nierstrasz. Context-Oriented Programming. Journal of Object Technology, March-April 2008, ETH Zurich, 7(3):125–151, 2008.
[8]
Oscar Nierstrasz, Stéphane Ducasse, and Damien Pollet. Squeak by Example. Square Bracket Associates, 2009.
[9]
Matthias Springer, Jens Lincke, and Robert Hirschfeld. Efficient Layered Method Execution in ContextAmber. In Proceedings of the 7th International Workshop on Context-Oriented Programming, COP’15, pages 5:1–5:6, New York, NY, USA, 2015. ACM.
[10]
Matthias Springer, Fabio Niephaus, Robert Hirschfeld, and Hidehiko Masuhara. Matriona: Class Nesting with Parameterization in Squeak/Smalltalk. In Proceedings of the 15th International Conference on Modularity, MODULARITY 2016, pages 129–141, New York, NY, USA, 2016. ACM.
[11]
Wakana Takeshita and Shigeru Chiba. Method Shells: Avoiding Conflicts on Destructive Class Extensions by Implicit Context Switches. In Walter Binder, Eric Bodden, and Welf Löwe, editors, Software Composition, volume 8088 of Lecture Notes in Computer Science, pages 49–64. Springer Berlin Heidelberg, 2013.
[12]
Peri Tarr, Harold Ossher, William Harrison, and Stanley M. Sutton, Jr. N Degrees of Separation: Multi-dimensional Separation of Concerns. In Proceedings of the 21st International Conference on Software Engineering, ICSE ’99, pages 107–119. ACM, 1999.
[13]
Alessandro Warth, Milan Stanojevi´c, and Todd Millstein. Statically Scoped Object Adaptation with Expanders. In Proceedings of the 21st Annual ACM SIGPLAN Conference on Object-oriented Programming Systems, Languages, and Applications, OOPSLA ’06, pages 37–56, New York, NY, USA, 2006. ACM. Introduction Background Requirements Contributions Examples Locality of Changes Hierarchical Scoping Importing Class Extensions Concept Rationale Scope of a Class Method Lookup Class Activation Related Work Summary

Cited By

View all
  • (2016)Classes as LayersProceedings of the 8th ACM International Workshop on Context-Oriented Programming10.1145/2951965.2951968(21-26)Online publication date: 17-Jul-2016

Index Terms

  1. Hierarchical layer-based class extensions in Squeak/Smalltalk

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Other conferences
    MODULARITY Companion 2016: Companion Proceedings of the 15th International Conference on Modularity
    March 2016
    217 pages
    ISBN:9781450340335
    DOI:10.1145/2892664
    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 the author(s) 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].

    In-Cooperation

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 14 March 2016

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Class extension
    2. context-oriented programming
    3. mixins

    Qualifiers

    • Research-article

    Conference

    Modularity '16

    Acceptance Rates

    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 07 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2016)Classes as LayersProceedings of the 8th ACM International Workshop on Context-Oriented Programming10.1145/2951965.2951968(21-26)Online publication date: 17-Jul-2016

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media