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.
- J. Aldrich, J. Sunshine, D. Saini, and Z. Sparks. Typestate-oriented programming. In Proc. Onward, 2009. Google Scholar
Digital Library
- J. Aldrich, K. Naden, and É. Tanter. Modular composition and state update in Plaid. In Proc. MechAnisms for SPEcialization, Generalization and inHerItance, MASPEGHI, 2010. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- A. Bejleri, J. Aldrich, and K. Bierhoff. Ego: Controlling the Power of Simplicity. In Proc. Foundations of Object-Oriented Languages, 2006.Google Scholar
- 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 Scholar
Digital Library
- L. Bettini, S. Capecchi, and F. Damiani. A Mechanism for Flexible Dynamic Trait Replacement. In Proc. Formal Techniques for Java-like Programs, 2009. Google Scholar
Digital Library
- K. Bierhoff and J. Aldrich. Lightweight object specification with typestates. In Proc. Foundations of Software Engineering, 2005. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- R. Deline and M. Fahndrich. Typestates for Objects. In Proc. European Conference on Object-Oriented Programming, 2004.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design patterns: elements of reusable object-oriented software. Addison-Wesley, 1995. Google Scholar
Digital Library
- D. Harel. Statecharts: A visual formalism for complex systems. Science of computer programming, 8 (3): 231--274, 1987. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- Jonathan Aldrich. The Plaid Language: Dynamic Core Specification, 2010. http://plaid-lang.googlecode.com/hg/docs/spec/current/current.pdf.Google Scholar
- A. C. Kay. The Early History of Smalltalk. SIGPLAN Notices, 28 (3), 1993. Google Scholar
Digital Library
- D. Malayeri and J. Aldrich. CZ: multiple inheritance without diamonds. Proc. Object-Oriented Programming, Systems, Languages, and Applications, 2009. Google Scholar
Digital Library
- B. Pernici. Objects with Roles. In Proc. Conference on Office Information Systems, 1990. Google Scholar
Digital Library
- B. C. Pierce. Advanced Topics in Types and Programming Languages. MIT Press, 2005. Google Scholar
Digital Library
- J. Reppy and A. Turon. Metaprogramming with traits. In Proc. European Conference on Object-Oriented Programming, 2007. Google Scholar
Digital Library
- A. Sterkin. State{chart}-Oriented Programming. In Proc. Multiparadigm Programming with Object-Oriented Languages, 2008.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- A. Taivalsaari. Object-Oriented Programming with Modes. Journal of Object-Oriented Programming, 6 (3): 25--32, 1993.Google Scholar
- D. Ungar and R. B. Smith. Self: The Power of Simplicity. In Proc. Object-Oriented Programming, Systems, Languages, and Applications, 1987. Google Scholar
Digital Library
- R. Wolff, R. Garcia, É. Tanter, and J. Aldrich. Gradual typestate. In European Conference on Object-Oriented Programming 2011. Google Scholar
Digital Library
Index Terms
First-class state change in plaid
Recommendations
First-class state change in plaid
OOPSLA '11: Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applicationsObjects 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. ...
Changing state in the plaid language
OOPSLA '11: Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companionPlaid is a language in which objects are defined not by fixed classes, but by changing abstract states. We will overview he Plaid programming language through a series of examples drawing from domains like I/O code and web applications. Attendees will ...
Modular composition and state update in Plaid
MASPEGHI '10: Proceedings of the 4th Workshop on MechAnisms for SPEcialization, Generalization and inHerItanceAt the core of the Plaid typestate-oriented programming language is the ability to change the representation of an object at run-time. As such, the semantics of the state change operation impact how Plaid programs are structured and how objects are ...







Comments