State Machines

  • A system or process, where it can only be in one state at a time

  • A collection of states, which when triggered by an event starts a transitions a state from the old state to a new state.

  • These events can be

    • Times/dates/timers will do something

    • incoming request to the system (http request, gui trigger)

    • Scheduled action

    • listening for some change somewhere (filesytem being updated, a queue)

  • When in the new state, it will take some actions

    • ie store the state in the database, inform the user (request/gui update), validate next transition from event (is event legal)

Examples

Last updated