ATM System (atmprj)


In this example, we consider two use cases (deposit and withdraw), and five scenarios (two for deposit and three for withdraw). The hierarchy of directories of atmprj before running SUIP is shown in Figure 1. The input data for SUIP are located in the leaf files of the hierarchy.

Figure1: hierarchy of sub-directories before running SUIP.

ClassD of ATM system (atmprj.ClassD)

The ClassD of this system is shown in Figure 2, and the textual format of this ClassD which is one of the inputs of SUIP can be found here.

Figure2: ClassD of the ATM system.


Scenarios of ATM system

Scenarios are acquired by use case and ordered by frequency of use.

Use Case Deposit

For the use case deposit, two scenarios (CollDs) are considered:

regularDeposit represents the scenario where a deposit operation is correctly registered (see Figure 3a). The corresponding textual format can be found in the file atmprj/UseCases/deposit/CollDs/regularDeposit/regularDepositLoan.CCollD ("CCollD": constrained CollD).

Figure 3a: scenario regularDeposit.


nipErrorDeposit occurs where the password entered by the user is not correct (see Figure 3b). The corresponding textual format can be found in the file atmprj/UseCases/deposit/CollDs/nipErrorDeposit/nipErrorDeposit.CCollD.


Figure 3b: scenario nipErrorDeposit.



Use Case Withdraw

For the use case withdraw, three scenarios (CollDs) are considered:

regularwithdraw represents the scenario where a withdraw operation is correctly registered (see Figure 4a). The corresponding textual format can be found in the file atmprj/UseCases/withdraw/CollDs/regularWithdraw/regularWithdraw.CCollD:

Figure 4a: scenario regularWithdraw.


balErrorWithdraw represents the case where there is no sufficient funds in the user account (see Figure 4b). The corresponding textual format can be found in the file atmprj/UseCases/withdraw/CollDs/balErrorwithdraw/balErrorwithdraw.CCollD.

Figure 4b: scenario balErrorwithdraw.


nipErrorWithdraw occurs where the user password is not correct (see Figure 4c). The corresponding textual format is put in the file atmprj/UseCases/withdraw/CollDs/nipErrorWithdraw/nipErrorWithdraw.CCollD.


Figure 4c: scenario cancelLoan.



After preparing the input files for SUIP (in this example: atmprj.ClassD, regularDeposit.CCollD, errorDeposit.CCollD, regularWithdraw.CCollD, balErrorWithdraw.CCollD, and nipErrorWithdraw.CcollD), SUIP generates UI prototypes for each interface object of the system. In the ATM system, we have only one interface object which is ATM. SUIP generates java files for this object in the directory atmprj/UIobjects/ATM/. SUIP also produces in the directory atmprj/StateDs/ Statecharts of all objects in the system.

To visualize the UI for the ATM object, you must:

  1. create a new empty project in the environment of Visual Cafe,
  2. menu File à New project à Empty project

  3. insert the java files generated for the object ATM (found in atmprj/UIobjects/ATM/) into this new project,
  4. menu Insert à Files into project

  5. execute the project in Visual Cafe. You can directly refine the frames generated in the interface builder of Visual Cafe.

menu Project à Execute