• No results found

In this section we describe the user’s SPF experience using the client GUI interface described in section 7.4 and the examples provided in section 7.5.

In this scenario we have two storage services running on machines calledFormido

andOnerous. Examples 7.3 and 7.4 show the files stored in the storage service. The two student data files are stored on separate machines but the SPF file view merges the directories to appear as a single directory. Thereadme.txt file appears on both machines and will appear as a replicated file.

Both of the example .NET libraries shown in section 7.5 have been added to the SPF. TheAdvancedFileInfoDLL is associated with all files and theTextInfo

Example 7.3:Shows the files stored in the storage service running onFormido. 1 sjj@formido> tree . 2 . 3 |-- StudentData 4 | ‘-- Fred.student 5 ‘-- readme.txt 6 1 directory 2 files

Example 7.4:Shows the files stored in the storage service running onOnerous.

1 sjj@onerous> tree . 2 . 3 |-- StudentData 4 | ‘-- John.student 5 ‘-- readme.txt 6 1 directory 2 files 7.6.1 Selecting an SPF method

The SPF windows client is shown in figure 7.7 and is divided into five regions. The lower region displays the properties of the currently selected object. In figure 7.7 this region displays information about the machineFormido.

The upper four regions are used to find and select methods associated with data files. For example, to select the GetLastAccessedTime method on the

readme.txtfile, the user’s four steps are shown in figure 7.7.

• Step 1

When the user interface loads, the client layer connects to a storage manager web service. The client then requests that all storage services return a list of all files and folders stored within the root SPF directory. These files are then collated and displayed in theSPF filetree view of the user interface. In this example the user has selected thereadme.txtfile.

• Step 2

When a file is selected in theSPF filetree, thepackagestree is then populated. This provides a list of all the packages (collections of classes) which are associ- ated with the selected file. In this example thereadme.txtfile has two asso- ciated packages, theAdvancedFileInfoand theTextInfopackage. Not all storage services have the capability to run all user code as the DLL may not exist on a particular resource. The client layer will automatically select a storage service to execute a method base on the machine’s load. In the GUI a user can see which machines are capable of running particular user code. Both the associated packages can run on either machine (OnerousorFormido). In this example the user has selected the AdvancedFileInfopackage on the machineFormido.

Select SPF file

Selected item properties

Select package Select class Select SPF method

1 2 3 4

Figure 7.7:Shows the SPF Windows client GUI built upon the client API layer. The four steps show how the user selects a method which is associated with a data file. As objects are selected their properties are displayed in the lower region of the GUI.

• Step 3

When a package is selected in thepackagestree, theclassestree is populated. This is a list of all the classes contained within the selected package. In this example there is just one class,AdvancedFileInfo.

• Step 4

When a class is selected in theclassestree, themethodstree is populated. When

theAdvancedFileInfoclass is selected the three methods shown in exam-

ple 7.1 are displayed. The user can then select a method and execute it using the process described in section 7.6.2.

7.6.2 Executing an SPF method

Once a user has selected the SPF method to execute, it can then be invoked and the results returned. When a user selects a method in theSPF Windows clientshown in figure 7.7 theexecute SPF methodwindow appears as shown in figure 7.8.

The four steps required to execute a method and obtain the results shown are described below:

• Step 1

Since a class can have many constructors the user can select the constructor. This is an optional step as the SPF will select a constructor with a single input parameter over others as the SPF can execute this without user intervention. Where a constructor only takes one parameter, the file name is automatically passed to the constructor. If more than one parameter is required the SPF

Check constructor parameters 1

Check method parameters 2

Execute the SPF method 3

View the results 4

Figure 7.8:Shows the GUI to execute an SPF method. When a user selects a method this window provides the user with optional constructor and method parameter modifications. The results of a method execution are displayed in the lower properties window.

will look for a suitable candidate, failing that it will resort to passing the file name in as the first parameter. Subsequent parameters are the responsibility of the user. In the GUI interface, users can supply primitive parameters using the constructor parameters option. In this example the class only has one constructor which takes the file name, thus the default options are used.

• Step 2

The default behaviour of the SPF is to execute a method without any pa- rameters. However users can provide primitive parameters by selecting the method parameter option. In this example the method does not take any pa- rameters.

• Step 3

Once a user has set the optional constructor and method parameters it can be invoked using the execute method button. This will cause the storage service where the file is located to request the DLL Manager to create an instance of the class and invoke the selected method. The results from this method are then serialised and passed back to the client layer using web services. The client layer returns the results object to the calling interface, in this example the GUI.

• Step 4

To demonstrate that the results of the method are returned as an object we display the properties of the object in the results view as shown in figure 7.8. It is expected that a user will take the return object and utilise it in a calling application. The GUI is intended to demonstrate the capabilities of the underlying API.