Typestate-oriented programming

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.

[1]  Jonathan Aldrich,et al.  EGO: Controlling the Power of Simplicity , 2006 .

[2]  Jonathan Aldrich,et al.  Practical API Protocol Checking with Access Permissions , 2009, ECOOP.

[3]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[4]  Robert E. Strom,et al.  Typestate: A programming language concept for enhancing software reliability , 1986, IEEE Transactions on Software Engineering.

[5]  Sophia Drossopoulou,et al.  Fickle : Dynamic Object Re-classification , 2001, ECOOP.

[6]  Max Brockman,et al.  What's Next?: Dispatches on the Future of Science , 2009 .

[7]  Brad A. Myers A new model for handling input , 1990, TOIS.

[8]  Eran Yahav,et al.  Effective typestate verification in the presence of aliasing , 2006, TSEM.

[9]  Paulo Marques,et al.  Concurrency by default: using permissions to express dataflow in stateful programs , 2009, OOPSLA Companion.

[10]  Ondrej Lhoták,et al.  Collaborative Runtime Verification with Tracematches , 2010, J. Log. Comput..

[11]  Kevin Bierhoff Iterator specification with typestates , 2006, SAVCBS '06.

[12]  Randall B. Smith,et al.  SELF: The power of simplicity , 1987, OOPSLA '87.

[13]  A. Tuszyński How does language shape the way we think , 2010 .

[14]  B. Pernici,et al.  Objects with roles , 1990, COCS '90.

[15]  Robert DeLine,et al.  Typestates for Objects , 2004, ECOOP.

[16]  Carl Hewitt,et al.  A Universal Modular ACTOR Formalism for Artificial Intelligence , 1973, IJCAI.

[17]  Sara Capecchi,et al.  A mechanism for flexible dynamic trait replacement , 2009, FTfJP@ECOOP.

[18]  Kristen Nygaard,et al.  SIMULA: an ALGOL-based simulation language , 1966, CACM.

[19]  David Harel,et al.  Statecharts: A Visual Formalism for Complex Systems , 1987, Sci. Comput. Program..

[20]  Jonathan Aldrich,et al.  Modular typestate checking of aliased objects , 2007, OOPSLA.

[21]  Alan C. Kay The early history of Smalltalk , 1993, HOPL-II.

[22]  Robin Milner,et al.  Definition of standard ML , 1990 .