Nothing Special   »   [go: up one dir, main page]

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

First-class state change in plaid

Published: 22 October 2011 Publication History

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.
[2]
J. Aldrich, K. Naden, and É. Tanter. Modular composition and state update in Plaid. In Proc. MechAnisms for SPEcialization, Generalization and inHerItance, MASPEGHI, 2010.
[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.
[4]
A. Bejleri, J. Aldrich, and K. Bierhoff. Ego: Controlling the Power of Simplicity. In Proc. Foundations of Object-Oriented Languages, 2006.
[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.
[6]
L. Bettini, S. Capecchi, and F. Damiani. A Mechanism for Flexible Dynamic Trait Replacement. In Proc. Formal Techniques for Java-like Programs, 2009.
[7]
K. Bierhoff and J. Aldrich. Lightweight object specification with typestates. In Proc. Foundations of Software Engineering, 2005.
[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.
[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.
[10]
R. Deline and M. Fahndrich. Typestates for Objects. In Proc. European Conference on Object-Oriented Programming, 2004.
[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.
[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.
[13]
E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design patterns: elements of reusable object-oriented software. Addison-Wesley, 1995.
[14]
D. Harel. Statecharts: A visual formalism for complex systems. Science of computer programming, 8 (3): 231--274, 1987.
[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.
[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.
[17]
Jonathan Aldrich. The Plaid Language: Dynamic Core Specification, 2010. http://plaid-lang.googlecode.com/hg/docs/spec/current/current.pdf.
[18]
A. C. Kay. The Early History of Smalltalk. SIGPLAN Notices, 28 (3), 1993.
[19]
D. Malayeri and J. Aldrich. CZ: multiple inheritance without diamonds. Proc. Object-Oriented Programming, Systems, Languages, and Applications, 2009.
[20]
B. Pernici. Objects with Roles. In Proc. Conference on Office Information Systems, 1990.
[21]
B. C. Pierce. Advanced Topics in Types and Programming Languages. MIT Press, 2005.
[22]
J. Reppy and A. Turon. Metaprogramming with traits. In Proc. European Conference on Object-Oriented Programming, 2007.
[23]
A. Sterkin. State{chart}-Oriented Programming. In Proc. Multiparadigm Programming with Object-Oriented Languages, 2008.
[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.
[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.
[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.
[27]
A. Taivalsaari. Object-Oriented Programming with Modes. Journal of Object-Oriented Programming, 6 (3): 25--32, 1993.
[28]
D. Ungar and R. B. Smith. Self: The Power of Simplicity. In Proc. Object-Oriented Programming, Systems, Languages, and Applications, 1987.
[29]
R. Wolff, R. Garcia, É. Tanter, and J. Aldrich. Gradual typestate. In European Conference on Object-Oriented Programming 2011.

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

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
  • 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
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 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. plaid
  2. state-chart
  3. typestate

Qualifiers

  • Research-article

Conference

SPLASH '11
Sponsor:

Acceptance Rates

Overall Acceptance Rate 268 of 1,244 submissions, 22%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)6
  • Downloads (Last 6 weeks)0
Reflects downloads up to 30 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Coconut: Typestates for Embedded SystemsCoordination Models and Languages10.1007/978-3-031-62697-5_12(219-238)Online publication date: 17-Jun-2024
  • (2023)Fluent APIs in Functional LanguagesProceedings of the ACM on Programming Languages10.1145/35860577:OOPSLA1(876-901)Online publication date: 6-Apr-2023
  • (2023)Shelley: A Framework for Model Checking Call Ordering on Hierarchical SystemsCoordination Models and Languages10.1007/978-3-031-35361-1_5(93-114)Online publication date: 15-Jun-2023
  • (2022)Session Coalgebras: A Coalgebraic View on Regular and Context-free Session TypesACM Transactions on Programming Languages and Systems10.1145/352763344:3(1-45)Online publication date: 15-Jul-2022
  • (2021)Propositions-as-types and shared stateProceedings of the ACM on Programming Languages10.1145/34735845:ICFP(1-30)Online publication date: 19-Aug-2021
  • (2021)PLIERSACM Transactions on Computer-Human Interaction10.1145/345237928:4(1-53)Online publication date: 23-Jul-2021
  • (2021)Polymorphic Iterable Sequential Effect SystemsACM Transactions on Programming Languages and Systems10.1145/345027243:1(1-79)Online publication date: 17-Apr-2021
  • (2021)Session Coalgebras: A Coalgebraic View on Session Types and Communication ProtocolsProgramming Languages and Systems10.1007/978-3-030-72019-3_14(375-403)Online publication date: 23-Mar-2021
  • (2020)ObsidianACM Transactions on Programming Languages and Systems10.1145/341751642:3(1-82)Online publication date: 25-Nov-2020
  • (2020)Typechecking Java Protocols with [St]MungoFormal Techniques for Distributed Objects, Components, and Systems10.1007/978-3-030-50086-3_12(208-224)Online publication date: 8-Jun-2020
  • Show More Cited By

View Options

Get Access

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