Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > PHP/MySQL/Scripting

  • Print
  • + Share This
Like this article? We recommend

States Involved in a Transaction

The user in Figure 1 expects to see the following state transitions when using the ecommerce program:

  1. Startup in the initial state.
  2. Moving from the initial state into the purchase state.
  3. Moving from the purchase state into the exit state.
  4. Moving from the exit state to the end of the program or back to the initial state.

Figure 2 illustrates some of the possible state transitions.

Figure 2

Figure 2 State transitions in the eCommerce program.

As Figure 2 shows, the program starts in the initial state. Next, it moves into the purchase state and from there into the exit state. As we’ll see, you can make the state transitions as complex as you like. The engine ensures that state transitions are orderly. Also, you can add an arbitrary number of new states just by cloning the code for one of the above states. I’m getting a little ahead of myself here, but you get the picture!

  • + Share This
  • 🔖 Save To Your Account