skip to main content
research-article

First-class state change in plaid

Authors Info & Claims
Published:22 October 2011Publication History
Skip Abstract Section

Abstract

Objects model the world, and state is fundamental to a faithful modeling. Engineers use state machines to understand and reason about state transitions, but programming languages provide little support for building software based on state abstractions. We propose Plaid, a language in which objects are modeled not just in terms of classes, but in terms of changing abstract states. Each state may have its own representation, as well as methods that may transition the object into a new state. A formal model precisely defines the semantics of core Plaid constructs such as state transition and trait-like state composition. We evaluate Plaid through a series of examples taken from the Plaid compiler and the standard libraries of Smalltalk and Java. These examples show how Plaid can more closely model state-based designs, enhancing understandability, enhancing dynamic error checking, and providing reuse benefits.

References

  1. J. Aldrich, J. Sunshine, D. Saini, and Z. Sparks. Typestate-oriented programming. In Proc. Onward, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. J. Aldrich, K. Naden, and É. Tanter. Modular composition and state update in Plaid. In Proc. MechAnisms for SPEcialization, Generalization and inHerItance, MASPEGHI, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. N. E. Beckman, D. Kim, and J. Aldrich. An empirical study of object protocols in the wild. In European Conference on Object-Oriented Programming 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. A. Bejleri, J. Aldrich, and K. Bierhoff. Ego: Controlling the Power of Simplicity. In Proc. Foundations of Object-Oriented Languages, 2006.Google ScholarGoogle Scholar
  5. A. Bergel, S. Ducasse, O. Nierstrasz, and R. Wuyts. Stateful traits and their formalization. Journal of Computer Languages, Systems and Structures, 34 (2): 83--108, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. L. Bettini, S. Capecchi, and F. Damiani. A Mechanism for Flexible Dynamic Trait Replacement. In Proc. Formal Techniques for Java-like Programs, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. K. Bierhoff and J. Aldrich. Lightweight object specification with typestates. In Proc. Foundations of Software Engineering, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Bloom, P. Keyser, I. Simmonds, and M. Wegman. Ferret: Programming language support for multiple dynamic classification. Computer Languages, Systems and Structures, 35 (3): 306 -- 321, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. T. V. Cutsem, A. Bergel, S. Ducasse, and W. D. Meuter. Adding state and visibility control to traits using lexical nesting. In Proc. European Conference on Object-Oriented Programming, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. Deline and M. Fahndrich. Typestates for Objects. In Proc. European Conference on Object-Oriented Programming, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  11. S. Drossopoulou, F. Damiani, M. Dezani-Ciancaglini, and P. Giannini. Fickle: Dynamic Object Re-classification. In Proc. European Conference on Object-Oriented Programming, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. i, Wuyts, and Black}ducasse2006traitsS. Ducasse, O. Nierstrasz, N. Sch\"arli, R. Wuyts, and A. Black. Traits: A mechanism for fine-grained reuse. ACM Transactions on Programming Languages and Systems, 28 (2): 331--388, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design patterns: elements of reusable object-oriented software. Addison-Wesley, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. D. Harel. Statecharts: A visual formalism for complex systems. Science of computer programming, 8 (3): 231--274, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. C. Hewitt, P. Bishop, and R. Steiger. A Universal Modular Actor Formalism for Artificial Intelligence. In Proc. International Joint Conference on Artificial Intelligence, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. C. Jaspan. Proper plugin protocols: Cost-effective verification of frameworks. Technical Report Carnegie Mellon University-ISR-11--101, Institute for Software Research, Carnegie Mellon University, April 2011. Thesis Proposal, originally accepted April 2010.Google ScholarGoogle Scholar
  17. Jonathan Aldrich. The Plaid Language: Dynamic Core Specification, 2010. http://plaid-lang.googlecode.com/hg/docs/spec/current/current.pdf.Google ScholarGoogle Scholar
  18. A. C. Kay. The Early History of Smalltalk. SIGPLAN Notices, 28 (3), 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. D. Malayeri and J. Aldrich. CZ: multiple inheritance without diamonds. Proc. Object-Oriented Programming, Systems, Languages, and Applications, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. B. Pernici. Objects with Roles. In Proc. Conference on Office Information Systems, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. B. C. Pierce. Advanced Topics in Types and Programming Languages. MIT Press, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Reppy and A. Turon. Metaprogramming with traits. In Proc. European Conference on Object-Oriented Programming, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. A. Sterkin. State{chart}-Oriented Programming. In Proc. Multiparadigm Programming with Object-Oriented Languages, 2008.Google ScholarGoogle Scholar
  24. S. Stork, P. Marques, and J. Aldrich. Concurrency by default: using permissions to express dataflow in stateful programs. In Proceeding of the 24th ACM SIGPLAN conference companion on Object oriented programming systems languages and applications, pages 933--940. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. R. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Transactions on Software Engineering, 12 (1): 157--171, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Sunshine, K. Naden, S. Stork, J. Aldrich, and É. Tanter. First-class state change in plaid. Technical Report Carnegie Mellon University-ISR-11--114, Institute for Software Research, Carnegie Mellon University, October 2011.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. A. Taivalsaari. Object-Oriented Programming with Modes. Journal of Object-Oriented Programming, 6 (3): 25--32, 1993.Google ScholarGoogle Scholar
  28. D. Ungar and R. B. Smith. Self: The Power of Simplicity. In Proc. Object-Oriented Programming, Systems, Languages, and Applications, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. R. Wolff, R. Garcia, É. Tanter, and J. Aldrich. Gradual typestate. In European Conference on Object-Oriented Programming 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. First-class state change in plaid

      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 46, Issue 10
        OOPSLA '11
        October 2011
        1063 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2076021
        Issue’s Table of Contents
        • cover image ACM Conferences
          OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
          October 2011
          1104 pages
          ISBN:9781450309400
          DOI:10.1145/2048066

        Copyright © 2011 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 22 October 2011

        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!