Typestate-oriented programming

Abstract
Objects model the world, and state is fundamental to a faith- ful modeling. Engineers use state machines to understand and reason about state transitions, but programming lan- guages provide little support for reasoning about or imple- menting these state machines, causing software defects and lost productivity when objects are misused. We propose Typestate-Oriented Programming as a nat- ural extension to the object paradigm, where objects are modeled not just in terms of classes, but in terms of chang- ing 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 develop- ers 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.

This publication has 14 references indexed in Scilit: