liveBook · Manning

State transition

A state transition is a change from one modeled state of a system, object, or process to another according to an event, action, condition, or rule.

How 7 Manning books explain it

Object-Oriented Software Design in C++

A state transition is a change from one object state to another caused by a change in member-variable values.

How it is used
Uses state transitions to visualize runtime behavior and organize actions that depend on an object’s current state.
How deep it goes
Explains member-variable changes, UML notation, guarded paths, terminal states, and polymorphic next-state handling.
Examples
Uses Car behavior, student enrollment, and a ticket machine with card validation, ticket counts, and a SOLD_OUT state.
What you can do after
Evaluate/understand runtime state changes and design a state-based class using UML diagrams or separate State subclasses.

Read how Object-Oriented Software Design in C++ explains state transition →

Software Design for Python Programmers

A state transition is a change from one object state to another caused by changes in one or more attributes.

How it is used
Models runtime behavior whose allowed actions and responses depend on an object's current state.
How deep it goes
Defines transitions and traces multiple conditional paths, while deferring implementation details of the State Design Pattern.
Examples
Uses an automatic ticket machine with card insertion, validation, ticket collection, card removal, rejection, and sold-out paths.
What you can do after
Evaluate object behavior by identifying states, attribute changes, triggering actions, conditions, and reachable transitions.

Read how Software Design for Python Programmers explains state transition →

React in Depth

A state transition is a state machine operation that changes the machine from one state to another in response to an event or condition.

How it is used
Models constrained application flow while coordinating data updates triggered by events.
How deep it goes
Defines legal events, targets, actions, context, selectors, and hooks, but does not develop formal state-machine theory.
Examples
Uses signup navigation and a list/detail application with add, view, complete, undo, remove, and persistence operations.
What you can do after
Apply it via XState by defining legal transitions, attaching context actions, and exposing machine state through React hooks.

Read how React in Depth explains state transition →

Functional Programming in Scala, Second Edition

A state action is a function that consumes an RNG state and returns a generated value together with a successor RNG state.

How it is used
Represents random computation as composable functions that thread RNG state without explicit repetitive passing.
How deep it goes
Defines the function representation and develops map, map2, sequence, flatMap, and imperative-style composition.
Examples
Uses nonNegativeEven, paired integer-double actions, list sequencing, and a candy-machine simulation.
What you can do after
Build state actions from scratch and combine them with map, map2, sequence, flatMap, and for-comprehensions.

Read how Functional Programming in Scala, Second Edition explains state transition →

Natural Language Processing in Action, Second Edition

A state transition is a change from one conversational state to another in response to an input or condition.

How it is used
Routes chatbot inputs through conversation graphs to select the next conversational state.
How deep it goes
Explains intents as graph edges and demonstrates YAML trigger routing, without detailing the underlying decision algorithm.
Examples
Uses an elementary counting tutor with correct-answer and wrong-answer routes for alternative user responses.
What you can do after
Build a conversation graph that maps anticipated user replies to target chatbot states.

Read how Natural Language Processing in Action, Second Edition explains state transition →

API Design Patterns

A state transition is a change of a resource from one status or condition to another.

How it is used
Guides API designers in deciding when a resource state change deserves a custom action instead of a standard update.
How deep it goes
Explains the conceptual distinction from scalar updates and identifies confusion and side effects, but stops short of implementing a custom action.
Examples
Uses an email moving from draft to sent, with UpdateEmail setting state to sent as the problematic design.
What you can do after
Apply custom actions to represent meaningful state changes rather than disguising them as ordinary field updates.

Read how API Design Patterns explains state transition →

Build and Orchestrator in Go (From Scratch)

A state transition is a change of a task from one lifecycle state to another in response to an event.

How it is used
Constrains task lifecycle changes during orchestration by allowing only event-driven transitions defined for each current state.
How deep it goes
Defines states, tabulates valid moves, and implements map-based validation while deferring a full state-machine abstraction.
Examples
Uses Pending, Scheduled, Running, Completed, and Failed states with ScheduleEvent, StartTask, and StopTask transitions.
What you can do after
Build it from scratch with a state map and helper that reject destinations not listed for the current state.

Read how Build and Orchestrator in Go (From Scratch) explains state transition →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.