January 2025
Intermediate to advanced
304 pages
8h 28m
English
The State pattern is usually associated with the idea of Finite State Machines (FSMs), a mathematical model of computation, but these are two different terms. While the FSM is a set of abstractions that help us create models for possible states in which a given machine can be, the State pattern is an Object-Oriented Programming (OOP) approach to abstract object states as objects. After these abstractions, you can implement an FSM to integrate these states and add transitions between one another. But just take note that the State pattern, besides being closely related to the FSM, is just the idea of encapsulating an object’s state into a new class and, with that, being able to change the object’s ...
Read now
Unlock full access