Using Maintain to Manage Data
Maintain combines power and simplicity in a single data
management facility. It incorporates the following features:
-
Object-oriented development. You
can define classes and declare objects that model the real-world
entities, such as customers and business transactions, with which
your enterprise deals. Object-oriented development saves you time
by making it easier for you to reuse source code by means of property
inheritance and class libraries, and enables you to leverage the
powerful Maintain language by creating your own data types.
-
Set-based processing. You
can manipulate a group of data source records at the same time.
You can define the group as a sequential range of records, as all
records that satisfy selection criteria, or a combination of the
two. For example, with one simple command you can select and retrieve
all of the records for the first 100 employees who have the job
code A25.
-
Record-at-a-time processing. In
addition to set-based processing, you can also identify and work
with one record at a time.
-
Sophisticated graphical user interface (GUI). You
can use the Winform Painter to create sophisticated interactive
forms, called Winforms, for entering data, displaying information,
and selecting options. You can design these Winforms to include user-friendly
features such as dialog boxes for requesting special information,
check boxes for making choices, list boxes for selecting values,
buttons for invoking functions, and entry fields with automatic
data validation for entering valid values.
-
Triggers and event-driven processing. The
flow of control in conventional processing is mostly pre-determined—that
is, the application developer determines the few paths that the
end user will be able to take through the procedure.
To make your
application more responsive to the end user—using the graphical user
interface—Maintain provides triggers and event-driven processing.
A trigger is a specified event that invokes or triggers a
function. Each time that the event (such as an end user pressing
a function key) occurs, the function is invoked. For example, you
might create a trigger for retrieving data: it would notice whenever
an end user presses the PF7 key while in a Winform at run time,
and would react by retrieving the specified data from the data source
and displaying it in the Winform for the user to edit.
-
Event-driven development. Developing
a procedure by writing out sequential lines of code may be sufficient
for conventional linear processing, but event-driven processing
demands event-driven development. Developing an application in this way
enables you to build much of the application's logic around the
user interface. For example, you can develop part of the user interface
(a Winform), then assign a trigger to a particular Winform event,
then specify the action (that is, the function) associated with
the trigger, and finally code the function—all from within the Winform
Painter.
-
Flow-of-control. Maintain
provides many different ways of controlling the flow of a procedure,
using enhanced versions of commands found in MODIFY as well as entirely
new commands and functions. For example, you can transfer control unconditionally
to functions, using PERFORM, and to procedures, using CALL; transfer control
conditionally using IF; declare functions (also known as cases)
with CASE, and simple blocks of code with BEGIN; and loop using
REPEAT.
-
Transaction Integrity. Maintain
enables you to define multiple data source operations as a single
transaction, and to ensure that the entire transaction is written
to the data source only if all of its component operations were
successful. Maintain does this by respecting your DBMS's native
transaction integrity strategy.
-
Modular processing. You
can create several Maintain procedures which work together, one
procedure calling another.
These are just some of the features you can use to develop powerful,
flexible, and robust data source management applications.