What is the meaning of "sub-state"? There is nothing in the state template that could be called a “sub-state”. "State" represents the state of an object. Every state is a state. If you do not give a reasonable explanation of what you are trying to achieve, I believe that you are thinking about something wrong.
As long as all states have the same base class / interface, it will work. You may have an inheritance relationship between states, they will still work and have nothing to do with the state template. And even you have inheritance relationships, they are still “states” and not “sub-states”
source share