HP 3000 Manuals

Creating a Model [ VIRTUOSO CODE GENERATOR Reference Manual ] MPE/iX 5.0 Documentation


VIRTUOSO CODE GENERATOR Reference Manual

Chapter 6  Creating a Model 

The generator accepts a Virtuoso source file as input.  If the Virtuoso
source file is reusable, the file is also called a model.  A model is
reusable because it does not contain specific data names or specific
logic.  One model may be used multiple times to perform the same logical
function but on different data corresponding to different problems.  For
example, a COBOL model which performs a maintenance transaction on a
master dataset may be used to generate a COBOL module to maintain a
master dataset in an order entry application or a COBOL module to
maintain a master dataset in an inventory application.  Models may be
reused within an application or from application to application.

A model (or a Virtuoso source file) is used to generate a complete
structure.  A COBOL model is used to generate a COBOL program or
subprogram; a documentation model is used to generate a document.
Macros, like models, are reusable components, but macros typically
perform a much smaller, narrowly-defined operation or function.  For
example, a macro might create a record, call an intrinsic, or perform
error handling.  Macros are called from within models and Virtuoso source
files to perform a task.

Models and macros enhance programmer productivity by providing a
mechanism to create reusable components.  By placing tested models and
macros into your library, you can reduce the amount of time spent in the
test/debug phase, since the code generated has already been tested.  In
addition, models and macros help to establish and implement your
organization's standard programming practices.  Standardization reduces
the variability in individual coding styles and makes maintenance more
straightforward.

It is up to you to determine whether a piece of code or text is reusable
and thus should become a model or a macro.

The previous chapters in this manual have discussed the basic features of
the Virtuoso Code Generator.  This chapter describes how to use these
features to create reusable components.  The discussion focuses on how to
create a model, but the same techniques may be used to create a macro.



MPE/iX 5.0 Documentation