gtpa2m3q | Application Programming |
ISO-C programs do not have the 4KB size limit that TARGET(TPF) programs do. If the need for organizing programs into packages comes mainly from this size constraint, performance gains can be realized by using calls to functions that reside in a single ISO-C program module. The performance gains result from avoiding the Enter protocol usually used for calling programs.
Typically, TPF programs are organized into packages. A package is a group of program segments designed to handle the processing for a given functional area. There is no rule about the number of segments in a package or the breadth of functionality covered. This is a function of the complexity of the application. The functionality to be programmed must be assessed and then broken into packages. The principal criteria should be efficient program development and, ultimately, good system performance.
An example of possible package structure is offered in Application Message Editor. All the functions of the application message editor might be grouped into a package. But again, it is a question of application complexity and variety of message types. Large applications will find it advisable to have multiple packages just to handle input. For example, some airlines have implemented a function relating to reservations, for fare quotation and ticket printing. The input messages may be long and involved. A separate package was designed just to edit input for a fare quote/ticketing request and pass the reformatted request to the quotation and ticketing functional packages.
Another possible approach is to group all programs required to handle a specific transaction into a package. For example, in the banking environment, the creation of a new customer account would be a transaction consisting of multiple messages, each supplying a data item required for the new account. Similar transaction types, those requiring essentially the same type of data and accessing the same files, might be combined into a single package.
It is outside the scope of this document, which is intended primarily as a programming guide, to offer a definitive discussion of application design. Following is a survey of some of the principal design considerations, and some miscellaneous programming tips.