skip to main content
10.1145/1040305.1040307acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article

Environmental acquisition revisited

Published:12 January 2005Publication History

ABSTRACT

In 1996, Gil and Lorenz proposed programming language constructs for specifying environmental acquisition in addition to inheritance acquisition for objects. They noticed that in many programs, objects are arranged in containment hierarchies and need to obtain information from their container objects. Therefore, if languages allowed programmers to specify such relationships directly, type systems and run-time environments could enforce the invariants that make these programming patterns work.In this paper, we present a formal version of environmental acquisition for class-based languages. Specifically, we introduce an extension of the ClassicJava model with constructs for environmental acquisition of fields and methods, a type system for the model, a reduction semantics, and a type soundness proof. We also discuss how to scale the model to a full-scale Java-like programming language.

References

  1. Dave Clarke and Sophia Drossopoulou. Ownership, encapsulation and the disjointness of type and effect. In Proceedings of the 17th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 292--310. ACM Press, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. David G. Clarke, John M. Potter, and James Noble. Ownership types for flexible alias protection. In Proceedings of the 13th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pages 48--64. ACM Press, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Microsoft Corporation. Microsoft C# Language Specifications. Microsoft Press, 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Robert Bruce Findler, John Clements, Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Paul Steckler, and Matthias Felleisen. DrScheme: A programming environment for Scheme. Journal of Functional Programming, 12(2):159--182, March 2002. A preliminary version of this paper appeared in PLILP 1997, LNCS volume 1292, pp. 369--388.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Matthew Flatt. PLT MzScheme: Language manual. Technical Report TR97-280, Rice University, 1997. http://www.plt-scheme.org/software/mzscheme/.]]Google ScholarGoogle Scholar
  6. Matthew Flatt and Robert~Bruce Findler. PLT MrEd: Graphical toolbox manual. Technical Report TR97-279, Rice University, 1997. http://www.plt-scheme.org/software/mred/.]]Google ScholarGoogle Scholar
  7. Matthew Flatt, Shriram Krishnamurthi, and Matthias Felleisen. A programmer's reduction semantics for classes and mixins. In Formal Syntax and Semantics of Java, volume 1523 of Springer Lecture Notes in Computer Science, pages 241--269. Springer-Verlag, 1999. Preliminary version appeared in proceedings of Principles of Programming Languages, 1998. Revised version is Rice University technical report TR 97-293, June 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Martin Fowler and Kendall Scott. UML Distilled: Applying the Standard Object Modeling Language. Addison-Wesley, Reading, MA, 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Jim Fulton. Extension classes, Python extension types become classes. http://debian.acm.ndsu.nodak.edu/doc/python-extclassExtensionClass.html.]]Google ScholarGoogle Scholar
  10. Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading, MA, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Joseph Gil and David H. Lorenz. Environmental acquisition: a new inheritance-like abstraction mechanism. In Proceedings of the Eleventh Annual Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 214--231. ACM Press, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Joseph (Yossi) Gil and David H. Lorenz. Object technology: Design patterns and language design. IEEE Computer, 31(3):118--120, March 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. James Gosling, Bill Joy, and Guy Steele, Jr. The Java Language Specification. Addison-Wesley, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Alan C. Kay. The early history of Smalltalk. In The Second ACM SIGPLAN Conference on History of Programming Languages, pages 69--95. ACM Press, 1993.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Shriram Krishnamurthi, Yan-David Erlich, and Matthias Felleisen. Expressing structural properties as language constructs. In European Symposium on Programming, volume 1576 of Springer Lecture Notes in Computer Science, pages 258--272, March 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Amos Latteier, Michel Pelletier, Chris McDonough, and Peter Sabaini. The Zope Book. SAMS, 2001. Also available on-line at http://zope.org/Documentation/Books/ZopeBook.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Mark Logan, Matthias Felleisen, and David Blank-Edelman. Environmental acquisition in network management. In Proceedings of LISA 2002: Sixteenth Systems Administration Conference, pages 175--184. USENIX Association, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Jacob Matthews, Robert Bruce Findler, Matthew Flatt, and Matthias Felleisen. A visual environment for developing context-sensitive term rewriting systems. In International Conference on Rewriting Techniques and Applications, 2004.]]Google ScholarGoogle ScholarCross RefCross Ref
  19. Bertrand Meyer. Eiffel: The Language. Prentice Hall, 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Sun Microsystems. Java 2 standard edition SDK, v1.4.2. http://wwws.sun.com/software/communitysource/j2se/java2/download.html.]]Google ScholarGoogle Scholar
  21. Sun Microsystems. Java foundation classes (JFC/Swing). http://java.sun.com/products/jfc/index.jsp.]]Google ScholarGoogle Scholar
  22. Python. http://www.python.org/.]]Google ScholarGoogle Scholar
  23. Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994. First appeared as Technical Report TR160, Rice University, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Environmental acquisition revisited

      Recommendations

      Reviews

      Markus Wolf

      The design of a programming language is a difficult business. On one hand, it has to follow the design ideas of its main paradigm, and be a tool for solving all kinds of problems suited to that paradigm. On the other hand, there are classes of recurring designs that cry out for special language constructs to deal with them more elegantly. This paper describes one instance of such a special class of designs, and how to extend Java-like languages to deal with it. Most object-oriented developers have encountered these designs, especially in graphical user interface (GUI) programming; one instance is known to the pattern community as the composite pattern. In order to handle such hierarchically composed structures, a lot of infrastructure code has to be programmed (always an error-prone business) to keep the structure consistent, and to fetch and set properties from somewhere down the containment hierarchy. The developer would rather express the relationship more directly in the programming language, so that the objects just acquire the needed properties from their hierarchical environment. This is where this paper starts. In the first section, the problem is defined and explained, and a short overview of early, informal, and experimental approaches to extending programming languages with constructs for environmental acquisition is presented. The second section presents some motivating examples, most of which are probably well known to the experienced object-oriented developer. The next section very briefly introduces the ClassicJava formal model for Java-like languages. The main section of the paper follows, and provides an introduction to Jacques, an extension of the ClassicJava model that supports the environmental acquisition of fields and methods. This section describes the syntax of the extension, the modifications needed in the type system, and the semantics of the language, and presents some sketches of a type soundness proof for the model. The fifth section discusses the design of Jacques, and explains why certain alternatives were chosen. Here, the authors clearly show which design decision was unavoidable, and which is open to discussion. They are well aware that only a future implementation, and some experiences with real-life programs, will decide some of the options. The last sections discuss how the model can be scaled to a full implementation in Java, cite some related work, and indicate what still has to be investigated before adding environmental acquisition to a real implementation of a programming language. This paper is very useful and understandable. Whether you are a developer who is interested in future design ideas in programming languages, or a real language designer on the hunt for new ideas, you will find something useful and interesting in this short paper. I hope that some of the ideas will find their way into the Java language sooner or later.

      Access critical reviews of Computing literature here

      Become a reviewer for Computing Reviews.

      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
        POPL '05: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
        January 2005
        402 pages
        ISBN:158113830X
        DOI:10.1145/1040305
        • General Chair:
        • Jens Palsberg,
        • Program Chair:
        • Martín Abadi
        • cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 40, Issue 1
          Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
          January 2005
          391 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1047659
          Issue’s Table of Contents

        Copyright © 2005 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: 12 January 2005

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Acceptance Rates

        Overall Acceptance Rate824of4,130submissions,20%

        Upcoming Conference

        POPL '25

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader