Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 871941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:42:46+00:00 2026-05-15T10:42:46+00:00

I have a state machine with many states A–B–C–D–E . I have many transitions

  • 0

I have a state machine with many states A--B--C--D--E. I have many transitions from C for example to A if some condition is verified. For every state I have a class extending abstract class Stateand I have a manager that delegates every transition method to state method. The question is “could states call directly manager transition methods?”. I have seen on Internet only examples in which there is a main class that knows exactly how many times transition happens (i.e. insertQuarter(), ejectQuarter(), turnCrank(), dispense()).
The only way I found to do this is to call manager transition methods in states. Is this wrong or bad practice?

Thanks in advance
Tobia

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:42:47+00:00Added an answer on May 15, 2026 at 10:42 am

    If you need a simple synchronous state machine, where at most one execution takes place at any given point in time, the model I’m thinking of is as follows:

    1) A context of the execution is represented by a Context object. The context is passed between the states, and it is used for flow decisions by the manager. The API of the context depends on how generic you need the system to be.

    2) State interface contains the execute(Context) method, where the specific logic takes place. It is allowed to use and change the context data.

    3) The manager is configured with the transition rules. It is able of determining the next state to execute, given the last state and the context. It starts by executing the initial state. After each execution of state S it checks the context object against the transition rules associated with the state S. When it reaches a terminal state, the flow is over.

    With this design, the state implementations are not aware of the manager in any way, and are not involved in routing decisions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build an QT State Maschine. I have some States, and
I have been using State machine based design tools for some time, and have
I have a class representing a finite-state machine, which should run in a forever
I have state machine where I have about 60 rows (transitions). It is not
I have a state machine design that needs to support playback. We have states
I have a state machine workflow hosted in SharePoint with a delay activity in
I have created a simple state machine model in Enterprise Architect and exported it
We have issues within an application using a state machine. The application is implemented
Does anyone have a solution for a basic, compact Finite state machine/automata written in
I have created a State machine workflow in WF 4.0 and it has following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.