An EGL file
contains a set of parts, each of which is a discrete, named unit. Some
parts (such as a program) are generatable parts;
each of these is the basis of a compilable unit. A generatable part must have
the same name as the EGL source file that contains the part; and in this case,
the case of the name is significant: myPart is different from MYPART.
An EGL source file (extension .egl) can include zero or one generatable
part and zero to many other parts.
Parts are also categorized in this way:
- Logic parts define a runtime sequence that you write in the EGL
procedural language--
- The non-generatable part function is the basic unit of logic. Every
other kind of logic part can include functions.
- You can define any of the following types of programs, which vary
by interface type. Each is a generatable part:
You can define any of the previous types of programs to be a main
program. That kind of program is started by a program transfer
other than a call, by an operating-system process, or in some cases by the
user. In addition, you can declare a basic or textUI program to be a called
program, which can be invoked only by a call.
For other
details on the runtime deployment of main and called programs, see runtime
configurations.
- A PageHandler is a generatable part that controls
the interaction between the user and a Web page.
- A Handler of type JasperReport is a generatable
part that contains customized functions which are invoked at different times
during execution of a JasperReports design file. The data returned from each
function is included in your output report, which can be rendered in PDF,
XML, text, CSV, or HTML format.
- A Service is a generatable part containing code
that will be accessed as follows:
- From EGL code by way of a TCP/IP connection (in which case the part contains
the implementation details of an EGL service); or
- From any code by way of an HTTP connection (in which case the part contains
the implementation details of an EGL Web service).
- A Library is also a generatable part; a collection
of shared functions and variables that can be made available locally to programs,
pageHandlers, EGL services, and other libraries.
- Data parts define the data structures that are available to your
program.
The following kinds of data parts are used as types in variable
declarations:
- DataItem parts contain information about the most elementary kind
of data. These parts are similar to entries in a system-wide data dictionary,
with each part including details on data size, type, formatting rules, input-validation
rules, and display suggestions. You define a DataItem part once and can use
it as the basis for any number of primitive variables or record fields.
The
DataItem part gives you a convenient way to create a variable from a primitive
type. For example, consider the following definition of myStringPart, which
is a DataItem part of type String:
DataItem
MyStringPart String { validValues = ["abc", "xyz"] }
end
When you develop a function, you can declare a variable
of type MyStringPart:
myString MyStringPart;
The
following declaration has the same effect as the previous one:
myString STRING { validValues = ["abc", "xyz"] };
As
shown, the name of a DataItem part is simply an alias for a primitive type
that has specific property settings.
- Record parts are a basis for complex data. A variable whose type
is a record part includes fields and is called a record.
Two categories
of record parts are available: fixed and non-fixed. The latter category is
more widely used, and we describe it first.
Each field in a non-fixed
record part can be based on any of these:
- A primitive type such as STRING
- A DataItem part
- A fixed-record part (as described later)
- Another record part
- An array of any of the preceding kinds
Each field also can be a Dictionary or ArrayDictionary (as described
later); or an array of Dictionaries or ArrayDictionaries.
You can use
a non-fixed record part to create variables for general processing or to access
a relational database.
The length of the data in the non-fixed record
can vary at run time.
- Fixed record parts are a basis for complex data that is of fixed
length. A variable whose type is a fixed record part includes fields, and
each field can have any of these as a type:
- A primitive type such as CHAR
- A dataItem part
Each field can be substructured. For example, a field that specifies
a telephone number can be defined as follows:
10 phoneNumber CHAR(10);
20 areaCode CHAR(3);
20 localNumber CHAR(7);
Although you can use fixed record parts for any kind of
processing, their best use is for I/O operations on VSAM files, MQSeries® messages
queues, and other sequential files.
To some extent, EGL supports fixed
record parts to allow compatibility with earlier products such as VisualAge Generator.
Although you can use fixed records for accessing relational databases or for
general processing, it is recommended that you avoid using fixed records for
those purposes.
- A Dictionary part is always available; you do not define it. A
variable that is based on a dictionary part may include a set of keys and
their related values, and you can add and remove key-and-value entries at
run time.
- An ArrayDictionary part is always available; you do not define
it. A variable that is based on an ArrayDictionary part lets you access a
series of arrays by retrieving the same-numbered element of every array. A
set of elements that is retrieved in this way is itself a dictionary, with
each array name treated as a key that is paired with the value in the array
element.
An ArrayDictionary is especially useful in relation to the display
technology described in Console user interface.
The other data part is a DataTable,
which is treated as a variable rather than as a type for a variable. The DataTable
is a generatable part that can be shared by multiple programs. It contains
a series of rows and columns; includes a primitive value in each cell; and
is treated as a variable that is (in most cases) global to the run unit.
- UI (user interface) parts describe the layout of data presented
to the user in fixed-font screen and print forms. UI parts are used in different
contexts and are of the following types:
- A record part of subtype ConsoleForm is
an organization of data that is presented to the user in the context of consoleUI
technology. Like other record parts, each is used as a type for one or more
variables; but in this case, each variable is called a console form rather
than a record. The ConsoleUI technology also includes other parts that are
defined for you and can be used as the basis of variables; for details, see Console
user interface.
- A Form is also an organization of data that
is presented to the user. One kind of form organizes the data sent to a screen
in a textUI program, and another organizes the data sent to a printer in any
kind of program.
Each form includes a fixed, internal structure like that
of a fixed record; but a form cannot include a substructure.
A form
is made available to a Program, PageHandler, or Library only if the form is
included or referenced by a FormGroup, as described next.
- A FormGroup part is a collection of text and
print forms and is a generatable part. A program can include only one formGroup
for most uses, along with one formGroup for help-related output. The same
form can be included in multiple FormGroups.
The forms in a FormGroup are
global to a program, though access must be specified in a program-specific
use statement. The forms are referenced as variables.
- A record part of subtype VGUIRecordis
an organization of data that is presented to the user in the context of a
VGWebTransaction program.
You create Web user interfaces with Page Designer, which builds a
JSP file and (when you are not working on a VGWebTransaction program) associates
the JSP file with an EGL PageHandler. The JSP file is similar to a UI part
for applications that interact with the user by way of the Web.
For
details on Web access, see Web support.
- Access parts allow you to interact with external code:
- An Interface part is a non-generatable part
that allows you to access functionality from an EGL service, from a Web service
(EGL or otherwise), or from Java™ code.
- The Report part and ReportData part are
predefined and are used as the basis of variables that help fill a report
at run time. The report is based on an open-source, Java-based library called
JasperReports. For an introduction to the EGL technology, see EGL reports
overview.
- Build parts are defined in EGL build files (extension .eglbld)
and define a variety of processing characteristics:
- A build descriptor part controls the generation process and indicates
what other control parts are read during that process.
- A linkage options part gives details on how a generated program
transfers to other programs. The
information in this part is used at generation time, test time, and run time.
- A resource associations part relates an EGL record with
the information needed to access a file on a particular target platform; the
information in this part is used at generation time, test time, and run time.
A fixed record, DataTable, or form (whether text or print) includes a fixed
structure. The structure is composed of a series of fields, each of which
has a size and type that is known at generation time; and in the case of a
DataTable or fixed record, the field can be substructured.