Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1639950.1640073acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
short-paper

Typestate-oriented programming

Published: 25 October 2009 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 reasoning about or implementing these state machines, causing software defects and lost productivity when objects are misused.
We propose Typestate-Oriented Programming as a natural extension to the object paradigm, where objects are modeled not just in terms of classes, but in terms of changing states. Each state may have its own representation and methods which may transition the object into a new state. A flow-sensitive, permission-based type system helps developers track which state objects are in. First-class typestates are a powerful abstraction that will help developers model and reuse objects more efficiently and correctly.

References

[1]
Andi Bejleri, Jonathan Aldrich, and Kevin Bierhoff. Ego: Controlling the Power of Simplicity. In Proc. Foundations of Object-Oriented Languages, 2006.
[2]
Lorenzo Bettini, Sara Capecchi, and Ferruccio Damiani. A Mechanism for Flexible Dynamic Trait Replacement. In Proc. Formal Techniques for Java-like Programs, 2009.
[3]
Kevin Bierhoff. Iterator Specification with Typestates. In Proc. Specification and Verification of Component-Based Systems, 2006.
[4]
Kevin Bierhoff and Jonathan Aldrich. Modular Typestate Checking of Aliased Objects. In Proc. Object-Oriented Programming, Systems, Languages, and Applications, 2007.
[5]
Kevin Bierhoff, Nels E. Beckman, and Jonathan Aldrich. Practical API Protocol Checking with Access Permissions. In Proc. European Conference on Object-Oriented Programming, 2009.
[6]
Eric Bodden, Laurie Hendren, Patrick Lam, Ondrej Lhotak, and Nomair A. Naeem. Collaborative Runtime Verification with Tracematches. Oxford Journal of Logics and Computation, 2008.
[7]
Lera Boroditsky. How Does Language Shape the Way We Think? In Max Brockman, editor, What's Next? Dispatches on the Future of Science, pages 116--129. Vintage, 2009.
[8]
Ole-Johan Dahl and Kristen Nygaard. SIMULA: an ALGOL-based Simulation Language. Communications of the ACM, 9(9):671--678, 1966.
[9]
Robert Deline and Manuel Fahndrich. Typestates for Objects. In Proc. European Conference on Object-Oriented Programming, 2004.
[10]
Sophia Drossopoulou, Ferruccio Damiani, Mariangiola Dezani-Ciancaglini, and Paola Giannini. Fickle: Dynamic Object Re-classification. In Proc. European Conference on Object-Oriented Programming, 2001.
[11]
Stephen J. Fink, Eran Yahav, Nurit Dor, G. Ramalingam, and Emmanuel Geay. Effective Typestate Verification in the Presence of Aliasing. Transactions on Software Engineering and Methodology, 17(2), 2008.
[12]
Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.
[13]
David Harel. Statecharts: A Visual Formalism for Complex Systems. Science of Computer Programming, 8(3):231--274, 1987.
[14]
Carl Hewitt, Peter Bishop, and Richard Steiger. A Universal Modular Actor Formalism for Artificial Intelligence. In Proc. International Joint Conference on Artificial Intelligence, 1973.
[15]
Alan C. Kay. The Early History of Smalltalk. SIGPLAN Notices, 28(3), 1993.
[16]
Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997.
[17]
Brad A. Myers. A New Model for Handling Input. ACM Transactions on Information Systems, 8(3):289--320, 1990.
[18]
Barbara Pernici. Objects with Roles. In Proc. Conference on Office Information Systems, 1990.
[19]
Asher Sterkin. State{chart}-Oriented Programming. In Proc. Multiparadigm Programming with Object-Oriented Languages, 2008.
[20]
Sven Stork, Paulo Marques, and Jonathan Aldrich. Concurrency by Default: Using Permissions to Express Dataflow in Stateful Programs. In Proc. Onward!, 2009.
[21]
Robert E Strom and Shaula Yemini. Typestate: A Programming Language Concept for Enhancing Software Reliability. IEEE Transactions on Software Engineering, 12(1):157--171, 1986.
[22]
Antero Taivalsaari. Object-Oriented Programming with Modes. Journal of Object-Oriented Programming, 6(3):25--32, 1993.
[23]
David Ungar and Randall B. Smith. Self: The Power of Simplicity. In Proc. Object-Oriented Programming, Systems, Languages, and Applications, 1987.

Cited By

View all
  • (2025)Algebraic Temporal Effects: Temporal Verification of Recursively Typed Higher-Order ProgramsProceedings of the ACM on Programming Languages10.1145/37049149:POPL(2306-2336)Online publication date: 9-Jan-2025
  • (2024)SquirrelFSProceedings of the 18th USENIX Conference on Operating Systems Design and Implementation10.5555/3691938.3691959(387-404)Online publication date: 10-Jul-2024
  • (2024)Law and Order for Typestate with BorrowingProceedings of the ACM on Programming Languages10.1145/36897638:OOPSLA2(1475-1503)Online publication date: 8-Oct-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
OOPSLA '09: Proceedings of the 24th ACM SIGPLAN conference companion on Object oriented programming systems languages and applications
October 2009
502 pages
ISBN:9781605587684
DOI:10.1145/1639950
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: 25 October 2009

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. objects
  2. paradigms
  3. permissions
  4. programming language
  5. states
  6. types
  7. typestate

Qualifiers

  • Short-paper

Conference

OOPSLA09
Sponsor:

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)35
  • Downloads (Last 6 weeks)5
Reflects downloads up to 13 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Algebraic Temporal Effects: Temporal Verification of Recursively Typed Higher-Order ProgramsProceedings of the ACM on Programming Languages10.1145/37049149:POPL(2306-2336)Online publication date: 9-Jan-2025
  • (2024)SquirrelFSProceedings of the 18th USENIX Conference on Operating Systems Design and Implementation10.5555/3691938.3691959(387-404)Online publication date: 10-Jul-2024
  • (2024)Law and Order for Typestate with BorrowingProceedings of the ACM on Programming Languages10.1145/36897638:OOPSLA2(1475-1503)Online publication date: 8-Oct-2024
  • (2024)Polymorphic Reachability Types: Tracking Freshness, Aliasing, and Separation in Higher-Order Generic ProgramsProceedings of the ACM on Programming Languages10.1145/36328568:POPL(393-424)Online publication date: 5-Jan-2024
  • (2024)Alice or Bob?: Process polymorphism in choreographiesJournal of Functional Programming10.1017/S095679682300011434Online publication date: 23-Jan-2024
  • (2024)Context-Aware Trace ContractsActive Object Languages: Current Research Trends10.1007/978-3-031-51060-1_11(289-322)Online publication date: 29-Jan-2024
  • (2023)Encapsulated Functions: Fortifying Rust's FFI in Embedded SystemsProceedings of the 1st Workshop on Kernel Isolation, Safety and Verification10.1145/3625275.3625397(41-48)Online publication date: 23-Oct-2023
  • (2023)Typed Design Patterns for the Functional EraProceedings of the 1st ACM SIGPLAN International Workshop on Functional Software Architecture10.1145/3609025.3609477(40-48)Online publication date: 30-Aug-2023
  • (2023)Fluent APIs in Functional LanguagesProceedings of the ACM on Programming Languages10.1145/35860577:OOPSLA1(876-901)Online publication date: 6-Apr-2023
  • (2023)Temporal Verification with Answer-Effect Modification: Dependent Temporal Type-and-Effect System with Delimited ContinuationsProceedings of the ACM on Programming Languages10.1145/35712647:POPL(2079-2110)Online publication date: 11-Jan-2023
  • Show More Cited By

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