I am looking into creating a very simple state machine. My state machine will contain the following 3 states:
public enum States {
PENDING,
ACTIVE,
DONE
}
There are multiple transitions + starting states that are possible here, specifically:
Initial States: PENDING or ACTIVE
Transitions:
PENDING -> ACTIVE
PENDING -> DONE
ACTIVE -> DONE
I'm looking into approaches to represent these states and a possible state machine to control the transitions. I've looked into an enum based approach such as this one, but I also want to expose state transitions to the client and I'm unsure if this is reasonable in this approach.
I've also looked at other techniques such as the State Pattern, but it feels like this may be overkill for such a simple ask.
Does anyone have any suggestions for simple state machine implementations that meet this criteria? I was even thinking something as basic as using a transition table to store the transitions and encapsulating a state concept within it that would use the transition table to determine next possible states.