With this principle, you can create a derived instance
from a reference instance and then use this derived instance to generate
the reference instance without duplicating its design. There are two
derivation types: the Design derivation and
the Code derivation. With the Design
derivation type, you create a derived instance to generate
the instance from a Library different from the one specified in the
reference instance. With the Code derivation type,
you create a derived instance which inherits the complete source code
(code generated from the design and specific code) of the reference
instance.
Design derivation
This derivation type is
available for the following entities: Program, Screen, Server, Data
Structure (for the generation of the Copybooks and the error messages),
Dialog (for the generation of the error messages), and Server Dialog.
It
is useful when an instance must be generated from different Libraries
(for example: A Program which must be generated for the CICS and IMS
platforms). You can create a derived instance which points to a reference
instance and to a generation Library. This derived instance does not
contain any design. You can then generate the reference instance from
another Library without duplicating its design.
To create the
derived instance, you must use the creation wizard of the entity.
For example, you use the Program creation wizard to create an instance
derived from a Program instance. Enter its required fields and check
the
Derive box. Then select
Design
derivation in the
Derivation type field
and specify the instance it is derived from in the
<Entity>
to derive field.
Tip: If you leave the Name blank,
check the Derive box and enter the reference
instance. The name of the derived instance is automatically initialized
with the name of the reference instance. You just need to complement
this name with the Library or any other distinctive code. This way,
they can be easily associated among all the available instances.
The
derived instance is displayed under the same entity as the instance
it is derived from, in the same location of the
Design Explorer view.
If you double-click it, it displays two tabs:
- The Overview tab, with a link to the reference
instance which contains the design and a link to the generation Library
- The Keywords tab.
Then you just have to generate the derived instance. It
actually generates the reference instance but with the parameters
of the generation Library selected in the derived instance.
Note: If
the design of the reference instance has been modified, the generation
of the derived instance takes this modification into account, except
if the change was only a change of Library.
The generated
COBOL file will be created, nested under this derived instance. This
way, you can keep as many COBOL files of the same instance as there
as generation targets.
Code derivation
This derivation type is
reserved for entities in which specific code can be inserted: Programs,
Screens, and Servers. It is useful when this specific code is distributed
among various Libraries.
You can create a derived instance
which does not contain any design but points to a reference instance.
The derived instance inherits the complete source code of the reference
instance.
When you generate a derived instance created with
a
Code derivation type, the following steps
take place:
- The instance referenced by the derived instance is automatically
generated. If the design or the specific code, or both, of this reference
instance have changed, these changes are taken into account, and a
reconciliation (process which integrates any changes in the design
while keeping the specific code) is automatically performed. This
step outputs the complete source code (the code generated from the
design and the specific code) of the reference instance.
- This complete source code is passed on to the derived instance,
where it is considered as the generated code. A new reconciliation
then reconciles this generated code with the specific code of the
derived instance.
Note: If you generate a derived instance, its reference instance
is automatically generated again, but the reverse is not true: If
you generate a reference instance, its derived instance is not automatically
generated.
From the same design of the same Pacbase instance, you can
then generate two source files with different COBOL codes. You can
repeat these operations from the derived instance, by selecting it
as the reference instance of a new derived instance...
The derived
instance is simple since it only contains one field: a reference to
the generatable instance (a Program, Screen, or Server).
To
create the derived instance, you must use the creation wizard of the
entity. For example, you use the Program creation wizard to create
an instance derived from a Program instance. Enter its required fields
and check the
Derive box. Then select
Code
derivation in the
Derivation type field.
You must specify the instance it is derived from (such as a Program,
Screen, or Server, or the derived instance of these entities).
Tip: If you leave the Name blank, check
the Derive box and enter the reference instance.
The name of the derived instance is automatically initialized with
the name of the reference instance. You just need to complement this
name with any distinctive code. This way, they can be easily associated
among all the available instances.
The derived instance
is displayed under the same entity as the instance it is derived from,
in the same location of the Design Explorer view.
If you double-click it, you will see that it only contains the Overview tab
(with the reference to the generatable instance) and the Keywords tab.