Let’s start with the same
struct as we had before:
We can add additional methods to this
We use the principle of encapsulation to expose an interface to modify the state. In this particular
instance, it may seem like overkill but it is good practice nonetheless.
The practical advantage of this is that it makes the state changes easy to test.