Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

General State Machine Pattern Questions #390

xrgarcia started this conversation in General
Discussion options

Howdy all!
I have just come across your project and am evaluating it to help me solve a problem. I want to build a state machine that allows people to configure infrastructure devices (routers, switches, etc). Here are some questions I have:

  1. to me a state machine will encapsulate the logic to change the state of a network device. For example, upgrading code. Beginning state is v1.0 end state would be v2.0. Is this a reasonable use case for this library?
  2. Will your library allow me to have an unhappy path? Say the disk on a router is full and i can't clear up disk space to copy the ISO img. I will need to update my database with all the useful details so a person can manually fix that, then the state machine can pick up where it left off. I noticed that guards might be the way to go here? If so can you elaborate?
  3. I want to have state meta data, such as a state number. For example, the initial state might have a number=1001 and every other state might increment 2001, 3001, etc. I am assuming I should create custom state classes that have any property i want? Is this an anti-pattern?
  4. Can a StateMachine have StateMachines? Each phase of my state machine will have phases of their own that might end up unsuccessful. Is this possible and is it anti-pattern?

Thanks for all the hard work! Sorry for the newbie questions :-)

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /