... | ... | @@ -16,8 +16,8 @@ An example class diagram is shown in [Example State Machine Diagram](#an-example |
|
|
Consider a state as a specific position within the life-cycle or behavior of an object during runtime of an application.
|
|
|
|
|
|
# Example Scenario
|
|
|
Assume that your customer wants you to develop an banking machine application called "ATM" which acts similar to general ATMs, which allow to withdraw or deposit cash. The application has two major states (Authentication or Withdrawal of Cash).
|
|
|
The application starts with Authentication, presents a login screen (openLogin), continues by allowing the user to enter a pin, which is checked afterwards (checkPin), and closes the login screen at the end (closeLogin). Depending on the result of the check (correct or incorrect), the number of unsuccessful tries (errorCounter), and the number of maximum tires (maxTries), the machine may change it's state to another state.
|
|
|
Assume that your customer wants you to develop a banking machine application called "ATM". It acts similar to general ATMs and thus allows to withdraw or to deposit cash. The application has two major states (Authentication or Withdrawal of Cash).
|
|
|
The application starts with Authentication, presents a login screen (openLogin), continues by allowing the user to enter a pin, which is checked afterwards (checkPin), and closes the login screen at the end (closeLogin). Depending on the result of the check (correct or incorrect), the number of unsuccessful tries (errorCounter), and the number of maximum tires (maxTries), the machine may change its state to another state.
|
|
|
|
|
|
Possible results are:
|
|
|
- Option 1: incorrect (pin) and errorCounter < maxTries --> try again.
|
... | ... | |