skip to main content
research-article

Ownership, filters and crossing handlers: flexible ownership in dynamic languages

Published:22 October 2012Publication History
Skip Abstract Section

Abstract

Sharing mutable objects can result in broken invariants, exposure of internal details, and other subtle bugs. To prevent such issues, it is important to control accessibility and aliasing of objects. Dynamic Ownership is an effective way to do so, but its owner-as-dominator discipline is too restrictive: objects are either accessible or not. We propose in this paper to control accessibility and aliasing with more flexibility using two mechanisms, filters and crossing handlers. We demonstrate the benefits of the flexibility offered by these mechanisms, and report on the adaptation of a Smalltalk web server with our approach. We conclude that our variant of dynamic ownership is flexible enough to accommodate an existing design, while at the same time constraining it enough to highlight design anomalies.

References

  1. M. Aksit, K. Wakita, J. Bosch, L. Bergmans, and A. Yonezawa. Abstracting object interactions using composition filters. In Proceedings of the Workshop on Object-Based Distributed Programming, ECOOP '93, pages 152--184, London, UK, UK, 1994. Springer-Verlag. ISBN 3--540--57932-X. URL http://dl.acm.org/citation.cfm?id=646775.705734. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Aldrich and C. Chambers. Ownership domains: Separating aliasing policy from mechanism. In ECOOP, pages 1--25, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  3. J. Aldrich, C. Chambers, and D. Notkin. Archjava: connecting software architecture to implementation. In ICSE, pages 187--197, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. J.-B. Arnaud, M. Denker, S. Ducasse, D. Pollet, A. Bergel, and M. Suen. Read-only execution for dynamic languages. In Proceedings of the 48th International Conference on Objects, Models, Components, Patterns (TOOLS EUROPE'10). LNCS Springer Verlag, July 2010. URL http://www.bergel.eu/download/papers/Berg10eReadOnly.pdf. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. J. Bloch. Effective Java (2nd Edition) (The Java Series). Prentice Hall PTR, Upper Saddle River, NJ, USA, 2 edition, 2008. ISBN 0321356683, 9780321356680. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Boyapati, B. Liskov, and L. Shrira. Ownership types for object encapsulation. SIGPLAN Not., 38 (1): 213--223, 2003. ISSN 0362--1340. http://doi.acm.org/10.1145/640128.604156. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. J. Boyland. Why we should not add readonly to Java (yet. In In FTfJP, pages 5--29, 2005.Google ScholarGoogle Scholar
  8. J. Boyland, J. Noble, and W. Retert. Capabilities for sharing: A generalisation of uniqueness and read-only. In Proceedings of the 15th European Conference on Object-Oriented Programming, ECOOP '01, pages 2--27, London, UK, UK, 2001. Springer-Verlag. ISBN 3--540--42206--4. URL http://dl.acm.org/citation.cfm?id=646158.680004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. G. Bracha and D. Ungar. Mirrors: design principles for meta-level facilities of object-oriented programming languages. SIGPLAN Not., 39: 331--344, October 2004. ISSN 0362--1340. http://doi.acm.org/10.1145/1035292.1029004. URL http://doi.acm.org/10.1145/1035292.1029004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Bykov, Kashai, Maddox, and Miranda}Brach10aG. Bracha, P. von der Ahé, V. Bykov, Y. Kashai, W. Maddox, and E. Miranda. Modules as objects in Newspeak. In ECOOP, pages 405--428, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. N. Cameron, J. Noble, and T. Wrigstad. Tribal ownership. In Proceedings of the ACM international conference on Object oriented programming systems languages and applications, OOPSLA '10, pages 618--633, New York, NY, USA, 2010. ACM. ISBN 978--1--4503-0203--6. http://doi.acm.org/10.1145/1869459.1869510. URL http://doi.acm.org/10.1145/1869459.1869510. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. D. Clarke and S. Drossopoulou. Ownership, encapsulation and the disjointness of type and effect. SIGPLAN Not., 37 (11): 292--310, Nov. 2002. ISSN 0362--1340. 10.1145/583854.582447. URL http://doi.acm.org/10.1145/583854.582447. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. lund, and Johnsen}Clar08aD. Clarke, T. Wrigstad, J. Östlund, and E. B. Johnsen. Minimal ownership for active objects. In Proceedings of the 6th Asian Symposium on Programming Languages and Systems, APLAS '08, pages 139--154, Berlin, Heidelberg, 2008. Springer-Verlag. ISBN 978--3--540--89329--5. http://dx.doi.org/10.1007/978--3--540--89330--1_11. URL http://dx.doi.org/10.1007/978--3--540--89330--1_11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. G. Clarke, J. M. Potter, and J. Noble. Ownership types for flexible alias protection. SIGPLAN Not., 33 (10): 48--64, Oct. 1998. ISSN 0362--1340. 10.1145/286942.286947. URL http://doi.acm.org/10.1145/286942.286947. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. T. V. Cutsem and M. S. Miller. On the design of the ECMAScript reflection api. Technical report, Vrije Universiteit Brussel, 2012.Google ScholarGoogle Scholar
  16. A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation, PLDI '09, pages 465--478, New York, NY, USA, 2009. ACM. ISBN 978--1--60558--392--1. 10.1145/1542476.1542528. URL http://doi.acm.org/10.1145/1542476.1542528. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. D. Gordon and J. Noble. Dynamic ownership in a dynamic language. In Proceedings of the 2007 symposium on Dynamic languages, DLS '07, pages 41--52, New York, NY, USA, 2007. ACM. ISBN 978--1--59593--868--8. http://doi.acm.org/10.1145/1297081.1297090. URL http://doi.acm.org/10.1145/1297081.1297090. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Hogg, D. Lea, A. Wills, D. deChampeaux, and R. Holt. The Geneva convention on the treatment of object aliasing. SIGPLAN OOPS Mess., 3 (2): 11--16, Apr. 1992. ISSN 1055--6400. 10.1145/130943.130947. URL http://doi.acm.org/10.1145/130943.130947. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. Kent and I. Maung. Encapsulation and aggregation. In In TOOLS Pacific 18. Prentice Hall, 1995.Google ScholarGoogle Scholar
  20. er, and Wallenburg}Rust08aK. R. Leino, P. Müller, and A. Wallenburg. Flexible immutability with frozen objects. In VSTTE '08: Proceedings of the 2nd international conference on Verified Software: Theories, Tools, Experiments, pages 192--208, Berlin, Heidelberg, 2008. Springer-Verlag. ISBN 978--3--540--87872--8. http://dx.doi.org/10.1007/978--3--540--87873--5_17. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P. Li, N. Cameron, and J. Noble. Cloning in ownership. In Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion, SPLASH '11, pages 63--66, New York, NY, USA, 2011. ACM. ISBN 978--1--4503-0942--4. 10.1145/2048147.2048175. URL http://doi.acm.org/10.1145/2048147.2048175. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. K. J. Lieberherr and I. M. Holland. Assuring good style for object-oriented programs. IEEE Softw., 6 (5): 38--48, Sept. 1989. ISSN 0740--7459. 10.1109/52.35588. URL http://dx.doi.org/10.1109/52.35588. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Y. Lu and J. Potter. On ownership and accessibility. In In ECOOP'06, volume 4067 of LNCS, pages 99--123. Springer-Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. S. Miller and J. S. Shapiro. Paradigm Regained: Abstraction Mechanisms for Access Control. LECTURE NOTES IN COMPUTER SCIENCE, pages 224--242, 2003.Google ScholarGoogle Scholar
  25. er and Poetzsch-Heffter(1999)}Muel99aP. Müller and A. Poetzsch-Heffter. Universes: A type system for controlling representation exposure. In A. Poetzsch-Heffter and J. Meyer, editors, Programming Languages and Fundamentals of Programming, pages 131--140. Fernuniversitat Hagen, 1999. Technical Report 263.Google ScholarGoogle Scholar
  26. er and Rudich(2007)}Mull07aP. Müller and A. Rudich. Ownership transfer in universe types. SIGPLAN Not., 42 (10): 461--478, Oct. 2007. ISSN 0362--1340. 10.1145/1297105.1297061. URL http://doi.acm.org/10.1145/1297105.1297061. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. Noble. Iterators and encapsulation. In Proceedings of the Technology of Object-Oriented Languages and Systems (TOOLS 33), pages 431--, Washington, DC, USA, 2000. IEEE Computer Society. ISBN 0--7695-0731-X. URL http://dl.acm.org/citation.cfm?id=832260.833174. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. J. Noble, J. Vitek, and J. Potter. Flexible alias protection. In ECCOP '98: Proceedings of the 12th European Conference on Object-Oriented Programming, pages 158--185, London, UK, 1998. Springer-Verlag. ISBN 3--540--64737--6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. Noble, D. Clarke, and J. Potter. Object ownership for dynamic alias protection. In In Proceedings TOOLS '99, pages 176--187. Society Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. lund et al.(2008)Östlund, Wrigstad, Clarke, and Åkerblom}Ostl08aJ. Östlund, T. Wrigstad, D. Clarke, and B. Åkerblom. Ownership, uniqueness, and immutability. In R. F. Paige and B. Meyer, editors, Objects, Components, Models and Patterns, 46th International Conference, TOOLS EUROPE 2008, volume 11 of phLecture Notes in Business Information Processing, pages 178--197. Springer, 2008. ISBN 978--3--540--69823--4. http://dx.doi.org/10.1007/978--3--540--69824--1_11.Google ScholarGoogle Scholar
  31. Rivard. Smalltalk: a reflective language. In Proceedings of Reflection'96, 1996.Google ScholarGoogle Scholar
  32. N. Scharli, A. P. Black, and S. Ducasse. Object-oriented encapsulation for dynamically typed languages. SIGPLAN Not., 39 (10): 130--149, Oct. 2004. ISSN 0362--1340. 10.1145/1035292.1028988. URL http://doi.acm.org/10.1145/1035292.1028988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. I. Sergey and D. Clarke. Gradual ownership types. In ESOP, pages 579--599, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. J. Sunshine, K. Naden, S. Stork, J. Aldrich, and E. Tanter. First-class state change in Plaid. In Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications, OOPSLA '11, pages 713--732, New York, NY, USA, 2011. ACM. ISBN 978--1--4503-0940-0. 10.1145/2048066.2048122. URL http://doi.acm.org/10.1145/2048066.2048122. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. T. Van Cutsem and M. S. Miller. Proxies: design principles for robust object-oriented intercession apis. SIGPLAN Not., 45 (12): 59--72, Oct. 2010. ISSN 0362--1340. 10.1145/1899661.1869638. URL http://doi.acm.org/10.1145/1899661.1869638. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. J. Voigt, W. Irwin, and N. Churcher. Intuitiveness of class and object encapsulation. In ph6th International Conference on Information Technology and Applications, 2009.Google ScholarGoogle Scholar
  37. T. Wrigstad, F. Pizlo, F. Meawad, L. Zhao, and J. Vitek. Loci: Simple thread-locality for java. In Proceedings of the 23rd European Conference on ECOOP 2009 -- Object-Oriented Programming, Genoa, pages 445--469, Berlin, Heidelberg, 2009. Springer-Verlag. ISBN 978--3--642-03012--3. 10.1007/978--3--642-03013-0_21. URL http://dx.doi.org/10.1007/978--3--642-03013-0_21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Y. Zibin, A. Potanin, M. Ali, S. Artzi, A. Kie, un, and M. D. Ernst. Object and reference immutability using java generics. In Proceedings of the the 6th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on The foundations of software engineering, ESEC-FSE '07, pages 75--84, New York, NY, USA, 2007. ACM. ISBN 978--1--59593--811--4. 10.1145/1287624.1287637. URL http://doi.acm.org/10.1145/1287624.1287637. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Ownership, filters and crossing handlers: flexible ownership in dynamic languages

    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

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 48, Issue 2
      DLS '12
      February 2013
      114 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2480360
      Issue’s Table of Contents
      • cover image ACM Conferences
        DLS '12: Proceedings of the 8th symposium on Dynamic languages
        October 2012
        128 pages
        ISBN:9781450315647
        DOI:10.1145/2384577

      Copyright © 2012 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 22 October 2012

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!