Generating and updating the HAF model (Code Generation Studio)

The scope of delivery of the Host Abstraction Framework contains a license of the Diomex Code Generation Studios.
This application enables you to generate and update a certain model and to release it in different languages for different platforms. One of the highlights of the CGS is the generation for the .NET Compact Framework and the support of Microsoft Team Foundation Server.

 

Browsing the model (Code Generation Studio)

If the HAF project is large, the respective model will grow very quickly, too. In order to still be able to find information quickly, CGS contains a flexible search enabling to browse the entire model or only certain areas of it (for ex. name spaces or data base structures).

 

 

Browsing for links (Code Generation Studio)

Since parts of a model are frequently connected to others (for ex. often a data base structure is used in divers programs as a parameter), the CGS offers a function for listing all the links to a certain object.

Creating a model (Code Generation Studio)

After the model has been created or modified, the model is translated into a source code by the means of the Code Generator. CGS supports different languages, platforms and different versions of Visual Studio. If the project to be generated is lying within the source code management (e.g. Microsoft Team Foundation Server), the CGS can recall existing files and analyse them. New files are automatically inserted into the source code management.

Importing RPG sources – step 1 (Code Generation Studio)

The CGS offers a function for importing RPG sources in order to facilitate the generation of CGS models for existing functions. The CGS downloads these sources directly from an iSeries system.

Importing RPG sources – step 2 (Code Generation Studio)

Once the functions to be imported have been selected, you define where the functions and data structures are to be created within the model. At this point the CGS detects, whether compatible structures for the parameters of the function to be imported exist already within the model and proposes them.

Exporting RPG sources (Code Generation Studio)

When creating new functions, it is reasonable to generate first the model and then the host side function. To facilitate this, CGS contains a function for generating RPG sources. The export function creates on one hand the data structure as well as an »empty« RPG program with the respective parameter task bar. The sources can be stored either on a hard disk or directly to an iSeries system via FTP.

Validating the host interface (Code Generation Studio)

To make sure that the structures determined within the model match with the programs of the host system, the CGS contains a function for validating the host interface. For this purpose, it retrieves the sources of the host program from the host system, analyses them and compares the respective parameters to the model.

Generating Stored Procedures for the .NET DB2-Provider (Code Generation Studio)

One of the possible communication providers for HAF based applications is the »HAF-Provider für IBM .NET DB2-Provider«. This provider retrieves functions from the host system as stores procedures. Since in the run-up to this, a stored procedure for each program has to be created, the CGS features a function for creating them automatically by the means of the model.

Generating a business object (Code Generation Studio)

Once the host side data structures have been defined in the Host-Access-Layer, these structures can be used for generating business objects in the so-called Business-Rules-Layer. In this step all the fields of a structure can be adopted automatically as properties in a new business object.

Scanning for not implemented fields (Code Generation Studio)

In order to transfer the extensions of a data structure as easily as possible into the generated business objects, CGS offers the possibility to transfer new fields automatically into the respective business object.

 

 

Designing functions for business objects (Code Generation Studio)

After having diverted a business object from a data structure, with the CGS functions (such as loading, saving etc.) can be defined directly inside the model.

Dialogue for generating a cache

HAF-Runtime supports very flexible caching functions, so that traffic between client and server is minimized. These caches can be defined directly with the CGS inside the model by determining the parameters for retrieving functions.

Connecting business objects (Code Generation Studio)

One of the biggest advantages of the HAF model is the possibility to connect business objects by the means of caches and function retrieval. The result is an object model that, regarding its handling, does not differ from a pure .NET application, even though behind an HAF based application you can find  regularly a very old backend, which is not object orientated.

Logging the communication with a host system (Trace Analyser)

Apart from the Code Generation Studio HAF encloses an application for debugging HAF based applications, the Trace Analyser. It allows logging the communication with the host system. Moreover, the TA permits the execution of single host functions step-by-step and also the reapplication of host functions with identical parameters.

Selecting the communication channel (Trace Analyser)

The Trace Analyser can communicate through different channels with an HAF based application. Thus, it is possible for example, to debug an HAF based application through the network. The screenshot shows the dialogue for selection the communication channel.

Tracing Activation (Trace Analyser)

Like a debugging tool, the Trace Analyser can be »attached« to an HAF based application retroactively. The screenshot shows the dialogue for selecting the process to be debugged.

Performance analysis (Trace Analyser)

In addition to the logging and debugging of an HAF based application, the TA analyses as well the performance of the functions on the host system. The screenshot shows the performance evaluation.

Saving a trace (Trace Analyser)

The communication record between client and host can be saved as text as well as .XML. The screenshot shows the dialogue for selecting the target format.