[Top] [Prev] [Next] [Bottom]

3. STOCKAPP Client Programs


A Look at STOCKAPP Client Programs

This chapter is devoted to the client side of the STOCKAPP sample application.

In the client-server architecture of the BEA TUXEDO system, there are two modes of communication:

System Client Programs

Figure 3-1 shows the hierarchy for STOCKAPP. The user selects one of the four service requests. The oval shapes in the illustration represent application services.

Figure 3-1 STOCKAPP Input/Output Hierarchy

Record Types

Message records are an essential part of the BEA TUXEDO system, as is the concept of typed records. In the BEA TUXEDO system, a typed record is a record designed to hold a specific data type. Five types are defined: VIEW, STRING, CARRAY, X_OCTET, and X_COMMON. Applications have the ability to define additional types.

BUY.cbl-A Request/response Client

BUY.cbl is an example of a client program. It makes account inquiries that call on the service BUYSR. As an executable, it is invoked as follows:

BUY

BUY.cbl Source Code

Because of space constraints we are not going to print the entire source code of BUY.cbl, but we want to call your attention to the following sections of the program:

* Now register the client with the system
* Issue a TPCALL
* Clean up

The indicated sections contain all of the places in BUY.cbl where the BEA TUXEDO ATMI calls are used. Note also that BUY.cbl is an example of a program that uses a VIEW typed record and a structure that is defined in the cust file. The source code for the structure can be found in the view description file, cust.V.

Building Client Programs

View description files, of which cust is an example, are processed by the view compiler, viewc(1). viewc has three output files: a COBOL file (CUST.cbl), a binary view description file (cust.V), and a header file (cust.h).

The client programs, BUY.cbl, FUNDPR.cbl, FUNDUP.cbl, and SELL.cbl, are processed by buildclient(1) to compile them and/or link edit them with the necessary BEA TUXEDO libraries.

You can use any of these commands individually, if you choose, but rules for all these steps are included in STOCKAPP.mk.

References

The use of ATMI calls in client programs is covered in Chapter 11, "Writing Client Programs."

The subject of typed records is covered in Chapter 10, "The BEA TUXEDO System Development Environment," and Chapter 11, "Writing Client Programs."

All commands and ATMI calls are described in Sections 1 and 3 of the BEA TUXEDO Reference Manual.



[Top] [Prev] [Next] [Bottom]