Did I implement State Machine Pattern correctly?
Im trying to implement State Machine Pattern for the state of a form, but I feel like it's not right or adding any convenience.
Context:
User fills in a form on my webpage. User then saves the form. Upon saving, the form should get one of the following states:
The state of a form is defined by business rules. For example:
I made an attempt to make a state machine pattern, but I can't seem to understand why it's useful. So maybe im not doing it correctly. Tips are very welcome.
How I implemented the State Machine Pattern:
FormStateService.cs
FormState.cs:
Each State has its own class like this with the business rules defined. For example this is what each stateclass looks like.
WaitForApprovalManagerState.cs
0 Replies