skip to main content
10.1145/2384577.2384589acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

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

Published: 22 October 2012 Publication History

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.
[2]
J. Aldrich and C. Chambers. Ownership domains: Separating aliasing policy from mechanism. In ECOOP, pages 1--25, 2004.
[3]
J. Aldrich, C. Chambers, and D. Notkin. Archjava: connecting software architecture to implementation. In ICSE, pages 187--197, 2002.
[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.
[5]
J. Bloch. Effective Java (2nd Edition) (The Java Series). Prentice Hall PTR, Upper Saddle River, NJ, USA, 2 edition, 2008. ISBN 0321356683, 9780321356680.
[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.
[7]
J. Boyland. Why we should not add readonly to Java (yet. In In FTfJP, pages 5--29, 2005.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[15]
T. V. Cutsem and M. S. Miller. On the design of the ECMAScript reflection api. Technical report, Vrije Universiteit Brussel, 2012.
[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.
[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.
[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.
[19]
S. Kent and I. Maung. Encapsulation and aggregation. In In TOOLS Pacific 18. Prentice Hall, 1995.
[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.
[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.
[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.
[23]
Y. Lu and J. Potter. On ownership and accessibility. In In ECOOP'06, volume 4067 of LNCS, pages 99--123. Springer-Verlag, 2006.
[24]
M. S. Miller and J. S. Shapiro. Paradigm Regained: Abstraction Mechanisms for Access Control. LECTURE NOTES IN COMPUTER SCIENCE, pages 224--242, 2003.
[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.
[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.
[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.
[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.
[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.
[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.
[31]
Rivard. Smalltalk: a reflective language. In Proceedings of Reflection'96, 1996.
[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.
[33]
I. Sergey and D. Clarke. Gradual ownership types. In ESOP, pages 579--599, 2012.
[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.
[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.
[36]
J. Voigt, W. Irwin, and N. Churcher. Intuitiveness of class and object encapsulation. In ph6th International Conference on Information Technology and Applications, 2009.
[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.
[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.

Cited By

View all

Index Terms

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

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    DLS '12: Proceedings of the 8th symposium on Dynamic languages
    October 2012
    128 pages
    ISBN:9781450315647
    DOI:10.1145/2384577
    • 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
    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

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 22 October 2012

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. encapsulation
    2. ownership

    Qualifiers

    • Research-article

    Conference

    SPLASH '12
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 32 of 77 submissions, 42%

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)2
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 23 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2018)Abstract and Concrete Data Types vs Object CapabilitiesPrincipled Software Development10.1007/978-3-319-98047-8_14(221-240)Online publication date: 24-Oct-2018
    • (2013)Efficient dynamic access analysis using JavaScript proxiesACM SIGPLAN Notices10.1145/2578856.250817649:2(49-60)Online publication date: 28-Oct-2013
    • (2013)Efficient dynamic access analysis using JavaScript proxiesProceedings of the 9th symposium on Dynamic languages10.1145/2508168.2508176(49-60)Online publication date: 28-Oct-2013
    • (2021)Analyzing permission transfer channels for dynamically typed languagesProceedings of the 17th ACM SIGPLAN International Symposium on Dynamic Languages10.1145/3486602.3486769(23-34)Online publication date: 19-Oct-2021

    View Options

    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