Library System

 

In this example, we consider two use cases (loan and return) and six scenarios three for each use case. The hierarchy of directories of libprj 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 the Library system (libprj.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.

Figure 2 : ClassD of the Library system.

Scenarios of the Library system

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

Use Case Loan

For the use case Loan, we consider three scenarios (CollDs) :

regularLoan represents the scenario where the loan is correctly registered (see Figure 3a). The corresponding textual format can be found in the file libprj/UseCases/loan/CollDs/regularLoan/regularLoan.CCollD ("CCollD": constrained CollD).

Figure 3a: scenario regularLoan.

errorUserLoan represents the case where the reader is not registered yet in the system (see Figure 3b). The corresponding textual format can be found in the file libprj/UseCases/loan/CollDs/errorUserLoan/errorUserLoan.CCollD.

Figure 3b: scenario errorUserLoan.

cancelLoan occurs when the attendant cancels the operation of creating a new loan (see Figure 3c). The corresponding textual format can be in the file libprj/UseCases/loan/CollDs/cancelLoan/cancelLoan.CCollD.

Figure 3c: scenario cancelLoan.

Use Case Return

For the use case return, we consider three scenarios:

regularReturn represents the scenario where the return is correctly registered (see Figure 4a). The corresponding textual format can be found in the file libprj/UseCases/return/CollDs/regularReturn/regularReturn.CCollD.

Figure 4a: scenario regularReturn.

errorDocReturn represents the case where the returned document is unknown by the system (see Figure 4b). The corresponding textual format can be found in the file libprj/UseCases/return/CollDs/errorDocReturn/errorDocReturn.CCollD.

Figure 4b: scenario errorDocReturn.

cancelReturn occurs when the attendant cancels the operation of returning documents (see Figure 4c). The corresponding textual format can be found in the file libprj/UseCases/return/CollDs/cancelReturn/cancelRetrun.CCollD.

Figure 4c: scenario cancelReturn.

 

After preparing the input files for SUIP (in this example: libprj.ClassD, regularLoan.CCollD, errorUserLoan.CCollD, cancelLoan.CCollD, regularReturn.CCollD, errorDocReturn.CCollD, and cancelReturn.CcollD), SUIP generates UI prototypes for each interface object of the system. In the Library example, we have only one interface object which is Terminal. SUIP generates java files for this object in the directory libprj/UIobjects/Terminal/. SUIP also produces in the directory libprj/StateDs/ Statecharts of all objects in the system.

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

1- create a new empty project in the environment of Visual Cafe,

menu File à New project à Empty project

2- insert the java files generated for the object Terminal (in libprj/UIobjects/Terminal/)

into this new project

menu Insert à Files into project

3- execute the project in Visual Cafe. You can directly refine the frames generated in the

interface builder of Visual Cafe.

menu Project à Execute