skip to main content
research-article

Homogeneous family sharing

Published:17 October 2010Publication History
Skip Abstract Section

Abstract

Recent work has introduced class sharing as a mechanism for adapting a family of related classes with new functionality. This paper introduces homogeneous family sharing, implemented in the J&h language, in which the sharing mechanism is lifted from class-level sharing to true family-level sharing. Compared to the original (heterogeneous) class sharing mechanism, homogeneous family sharing provides useful new functionality and substantially reduces the annotation burden on programmers by eliminating the need for masked types and sharing declarations. This is achieved through a new mechanism, shadow classes, which permit homogeneous sharing of all related classes in shared families. The new sharing mechanism has a straightforward semantics, which is formalized in the J&h calculus. The soundness of the J&h type system is proved. The J&h language is implemented as an extension to the J& language. To demonstrate the effectiveness of family sharing, the Polyglot compiler framework is ported to J&h.

References

  1. }}Ivica Aracic, Vaidas Gasiunas, Mira Mezini, and Klaus Ostermann. An overview of CaesarJ. In Awais Rashid and Mehmet Aksit, editors, Lecture Notes in Computer Science: Transactions on Aspect-Oriented Software Development I, pages 135--173. Springer-Verlag, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}Miles Barr and Susan Eisenbach. Safe upgrading without restarting. In Proceedings of 19th International Conference on Software Maintenance (ICSM), pages 129--137, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}Alexandre Bergel, Stéphane Ducasse, and Oscar Nierstrasz. Classbox/J: Controlling the scope of change in Java. In Proc. ACM OOPSLA 2005, pages 177--189, San Diego, CA, USA, October 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}Gilad Bracha and William Cook. Mixin-based inheritance. In Norman Meyrowitz, editor, Proc. ACM OOPSLA '90, pages 303--311, Ottawa, Canada, 1990. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}Kim B. Bruce. Safe static type checking with systems of mutually recursive classes and inheritance. Technical report, Pomona College, 1997. http://www.cs.pomona.edu/ kim/ftp/RecJava.ps.gz.Google ScholarGoogle Scholar
  6. }}Kim B. Bruce, Martin Odersky, and Philip Wadler. A statically safe alternative to virtual types. In European Conference on Object-Oriented Programming (ECOOP), number 1445 in Lecture Notes in Computer Science, pages 523--549. Springer-Verlag, July 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. }}Eric Bruneton, Romain Lenglet, and Thierry Coupaye. ASM: A code manipulation tool to implement adaptable systems, 2002. http://asm.objectweb.org/current/asm-eng.pdf.Google ScholarGoogle Scholar
  8. }}B. Cahoon and K. S. McKinley. Data flow analysis for software prefetching linked data structures in Java. In International Conference on Parallel Architectures and Compilatio n Techniques (PACT), September 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}Dave Clarke, Sophia Drossopoulou, James Noble, and Tobias Wrigstad. Tribe: A simple virtual class calculus. In AOSD '07: Proceedings of the 6th International Conference on Aspect-Oriented Software Development, pages 121--134, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}Curtis Clifton, Gary T. Leavens, Craig Chambers, and Todd Millstein. MultiJava: Modular open classes and symmetric multiple dispatch for Java. In Proc. 15th ACM Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pages 130--145, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}Adriana B. Compagnoni and Benjamin C. Pierce. Higher order intersection types and multiple inheritance. Mathematical Structures in Computer Science, 6(5):469--501, 1996.Google ScholarGoogle ScholarCross RefCross Ref
  12. }}Ferruccio Damiani, Sophia Drossopoulou, and Paola Giannini. Refined effects for unanticipated object re-classification: FickleIII. In ICTCS, pages 97--110, 2003.Google ScholarGoogle Scholar
  13. }}Erik Ernst. gbeta - a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Department of Computer Science, University of Aarhus, Aarhus, Denmark, 1999.Google ScholarGoogle Scholar
  14. }}Erik Ernst. Propagating class and method combination. In Proc. Thirteenth European Conference on Object-Oriented Programming (ECOOP'99), number 1628 in Lecture Notes in Computer Science, pages 67--91. Springer-Verlag, June 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}Erik Ernst. Family polymorphism. In Proc. 15th European Conference on Object-Oriented Programming (ECOOP), LNCS 2072, pages 303--326, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}Erik Ernst, Klaus Ostermann, and William R. Cook. A virtual class calculus. In Proc. 33rd ACM Symp. on Principles of Programming Languages (POPL), pages 270--282, Charleston, South Carolina, January 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. }}Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley, Reading, MA, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}Stephan Herrmann. Object teams: Improving modularity for crosscutting collaborations. In Proc. Net Object Days, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. }}Atsushi Igarashi and Benjamin Pierce. Foundations for virtual types. In Proc. Thirteenth European Conference on Object-Oriented Programming (ECOOP'99), number 1628 in Lecture Notes in Computer Science, pages 161--185. Springer-Verlag, June 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. }}Atsushi Igarashi and Mirko Viroli. Variant path types for scalable extensibility. In Proc. 22nd ACM Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pages 113--132, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}O. Lehrmann Madsen, B. Møller-Pedersen, and K. Nygaard. Object Oriented Programming in the BETA Programming Language. Addison-Wesley, June 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual classes: A powerful mechanism for object-oriented programming. In Proc. ACM OOPSLA '89, pages 397--406, October 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. }}Mira Mezini and Klaus Ostermann. Conquering aspects with Caesar. In Proc. 2nd International Conference on Aspect-Oriented Software Development (AOSD), pages 90--100, Boston, Massachusetts, March 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}Mira Mezini, Linda Seiter, and Karl Lieberherr. Component integration with pluggable composite adapters. Software Architectures and Component Technology, 2000.Google ScholarGoogle Scholar
  25. }}Iulian Neamtiu and Michael Hicks. Safe and timely dynamic updates for multi-threaded programs. In Proc. SIGPLAN 2009 Conference on Programming Language Design and Implementation, pages 13--24, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. }}Iulian Neamtiu, Michael Hicks, Gareth Stoyle, and Manuel Oriol. Practical dynamic software updating for C. In Proc. SIGPLAN 2006 Conference on Programming Language Design and Implementation, pages 72--83, June 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. }}Anders Bach Nielsen and Eric Ernst. Virtual class support at the virtual machine level. In VMIL '09: Proceedings of the third workshop on Virtual Machines and Intermediate Languages, October 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. }}Nathaniel Nystrom, Stephen Chong, and Andrew C. Myers. Scalable extensibility via nested inheritance. In Proc. ACM OOPSLA 2004, pages 99--115, October 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. }}Nathaniel Nystrom, Michael R. Clarkson, and Andrew C. Myers. Polyglot: An extensible compiler framework for Java. In Proc. 12th International Compiler Construction Conference (CC'03), pages 138--152, April 2003. LNCS 2622. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. }}Nathaniel Nystrom, Xin Qi, and Andrew C. Myers. J&: Nested intersection for scalable software composition. In Proc. ACM OOPSLA 2006, pages 21--36, October 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. }}Nathaniel Nystrom, Xin Qi, and Andrew C. Myers. Nested intersection for scalable software composition. Technical report, Computer Science Dept., Cornell University, September 2006. http://www.cs.cornell.edu/nystrom/papers/jet-tr.pdf.Google ScholarGoogle Scholar
  32. }}Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Sebastian Maneth, Stéphane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. An overview of the Scala programming language, June 2004. http://scala.epfl.ch/docu/files/ScalaOverview.pdf.Google ScholarGoogle Scholar
  33. }}Martin Odersky and Matthias Zenger. Scalable component abstractions. In Proc. ACM OOPSLA 2005, pages 41--57, October 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. }}Klaus Ostermann. Dynamically composable collaborations with delegation layers. In Proc. 16th European Conference on Object-Oriented Programming (ECOOP), volume 2374 of Lecture Notes in Computer Science, pages 89--110, Málaga, Spain, 2002. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. }}Xin Qi and Andrew C. Myers. Masked types for sound object initialization. In Proc. 36th ACM Symp. on Principles of Programming Languages (POPL), pages 53--65, January 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. }}Xin Qi and Andrew C. Myers. Sharing classes between families. In Proc. SIGPLAN 2009 Conference on Programming Language Design and Implementation, pages 281--292, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. }}Xin Qi and Andrew C. Myers. Sharing classes between families: technical report. Technical report, Computing and Information Science, Cornell University, March 2009. http://hdl.handle.net/1813/12141.Google ScholarGoogle Scholar
  38. }}Xin Qi and Andrew C. Myers. Homogeneous family sharing: technical report. Technical report, Computing and Information Science, Cornell University, July 2010. http://hdl.handle.net/1813/15845.Google ScholarGoogle Scholar
  39. }}John C. Reynolds. Design of the programming language Forsythe. Technical Report CMU-CS-96-146, Carnegie Mellon University, June 1996.Google ScholarGoogle Scholar
  40. }}Yannis Smaragdakis and Don Batory. Mixin layers: An object-oriented implementation technique for refinements and collaboration-based designs. ACM Transactions on Software Engineering and Methodology, 11(2):215--255, April 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. }}Charles Smith and Sophia Drossopoulou. Chai: Traits for Java-like languages. In Proceedings of 19th European Conference on Object-Oriented Programming (ECOOP'05), pages 453--478, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. }}Suriya Subramanian, Michael Hicks, and Kathryn S. McKinley. Dynamic software updates: A VM-centric approach. In Proc. SIGPLAN 2009 Conference on Programming Language Design and Implementation, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. }}Kresten Krab Thorup. Genericity in Java with virtual types. In Proc. European Conference on Object-Oriented Programming (ECOOP), number 1241 in Lecture Notes in Computer Science, pages 444--471. Springer-Verlag, 1997.Google ScholarGoogle Scholar
  44. }}Mads Torgersen. Virtual types are statically safe. In 5th Workshop on Foundations of Object-Oriented Languages (FOOL), January 1998.Google ScholarGoogle Scholar
  45. }}Alessandro Warth, Milan Stanojević, and Todd Millstein. Statically scoped object adaptation with expanders. In Proc. 21st ACM Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), Portland, OR, October 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. }}Andrew K. Wright and Matthias Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38--94, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Homogeneous family sharing

            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 45, Issue 10
              OOPSLA '10
              October 2010
              957 pages
              ISSN:0362-1340
              EISSN:1558-1160
              DOI:10.1145/1932682
              Issue’s Table of Contents
              • cover image ACM Conferences
                OOPSLA '10: Proceedings of the ACM international conference on Object oriented programming systems languages and applications
                October 2010
                984 pages
                ISBN:9781450302036
                DOI:10.1145/1869459

              Copyright © 2010 ACM

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 17 October 2010

              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!