Shared Application Client

Version: 1.4
Author: Susanne Lefvert <lefvert@mcs.anl.gov>
Status: Draft
Contact: ag-tech@mcs.anl.gov

Abstract

This enhancement proposal describes design and implementation of a shared application client that will simplify development of shared applications.

Overview

The AGTk 2.0 currently includes an interface for building shared applications. After several applications have been created using this interface, it is apparent that application clients share some common code, especially in the initialization phase. To avoid redundant code, parts of shared applications would be extracted into a shared application class, the SharedAppClient. The new class will make it possible to re-use existing code and make it easier to develop shared applications. It will also enable caching of application data that will reduce the amount of SOAP calls made between clients and the service. Furthermore, SOAP exceptions can be made transparent to the application developer and converted into python exceptions in the new client class.

Summary of Modifications

Design

SharedAppClient Specification

Attributes:

  • publicId
  • privateId
  • channelId
  • appProxy
  • appUrl
  • appName

Methods:

  • __Init__(appName)
  • InitLogging(debugMode = 0, logFile = None)
  • Connect(appServiceUrl)
  • Shutdown()
  • RegisterEventCallback (name, callback)
  • SendEvent(eventType, data)
  • GetData(dataKey)
  • SetData(dataKey, dataValue)
  • GetPublicId()
  • GetApplicationId()
  • GetComponents()

Class Overview

 -----------------
| SharedAppService |
 -----------------
         A
         | 
         |
 ----------------            -----------
| SharedAppClient | ------O | SharedApp |
 ----------------            -----------
Note: SharedApp has a SharedAppClient,
SharedAppClient communicates with SharedAppService via SOAP interface

Reference Implementation

Sample code of the Shared Browser using the SharedAppClient can be found at [1].

Note: This reference implementation does not include a callback table, caching of data, or SOAP exception conversions.

Rationale

The aim of this AGEP is to provide a client side interface to application services. By encapsulating details such as eventClient, ID's, and SOAP proxy from the developer, shared applications should be cleaner and more straightforward to implement. Ideally, a developer should only need to include the SharedAppClient, and in some cases the DataStoreClient, from the AccessGrid toolkit in order to write shared applications.

The client will implement all methods found in the application service interface to entirely hide the SOAP layer from application developers. SOAP exceptions can then be handled transparent to the application developer and converted to python exceptions in the client. Additionally, the client should cache application data, thus reducing the number of SOAP calls made to the service. Finally, by implementing a callback table in the client, several callbacks can be registered for each event.

Interoperability Issues

Shared applications currently available will still work without using the SharedAppClient. However, application code can be reduced and readability increased if redesign is implemented.

References

[1]Reference implementation: http://www-unix.mcs.anl.gov/~lefvert/AGEP/AGEP.html (AGEP Shared Application Client for AGTk 2.0)

Open Issues

Do we need GetApplicationId() and GetComponents()?

GetApplicationId() would call GetId() in the AppObjectImpl class.