IBM 1130 User Manual page 185

Computing system
Hide thumbs Also See for 1130:
Table of Contents

Advertisement

Section
Subsections
Page
25
30
I
20
01
Modular Programming
General
Modular programming is used to divide your problem
solution into its logical parts or routines so that
each routine may be programmed independently.
It
enables your complex problems to be divided into
many simple sections. A building block program is
thereby created that is controlled by a single routine
commonly known as the "main line" .
A modular program utilizes the same communi-
cation system as established by an organization
chart. Work assignment decisions are made by the
main line routine, which is not concerned with the
functions of the processing routines.
If
for some
reason a routine is revised or eliminated, other
processing routines within the program are not
affected. However, a segment of the main line
might be changed.
There are three primary design criteria of mod-
ular programming: ease of understanding, ease of
program modification, standardization of program
construc tion.
To prepare and use an operational program
effectively and efficiently, you must be able to
understand the content of the program readily. Ease
of understanding is provided in the following three
ways:
1.
Modular flowcharts. A modular system flow-
chart gives an overall picture of the major compo-
nents and structure of the routine; program flow-
charts then progress to any desired level of detail,
depending on the complexity of the routine. The
program coding is referenced throughout.
2. Detailed narrative of each routine. The nar-
rative of each routine states the purpose of the
routine, describes the data processed by the routine,
and explains each step of the program logic as por-
trayed by the modular flowchart of the routine.
3. Programming conventions. The use of stand-
ard labeling conventions and standard program docu-
mentation techniques enables a person unfamiliar
with the program to readily understand the program
content.
Years of experience have shown that, with 98%
assurance, all of your operational programs will
require modification and change during their useful
life. Ease of program modification is of cardinal
importance when your program must be converted to
fit a specific new situation. This may be because of
changing company policy, varied environmental
parameters or different management objectives.
Your programmer, then, has the problem of crea-
ting a program that can be adjusted to each specific
situation. There are two ways of handling this
problem.
One is to try to anticipate every type of special
situation that might be encountered and write a set
of routines to handle each situation. This would
require a fantastic ability to forecast the future and
would lead to slow, cumbersome programs.
The other alternative is to create a program that
can be quickly understood and easily modified to re-
flect changing conditions. Modular programming
aims to accomplish the latter alternative.
Once again, you may more readily prepare and
more quickly implement an operational program if
all the runs (programs) within your application ad-
here to a standardized construction. As indicated
above, the logical structure of your program must
be such that modifications and additions can be
easily made.
Consider the problem of multiple routines - for
instance, three economic order quantity routines.
The normal method of lumping these three routines
into a program necessitates setting switches to tell
the program which routine to excute at a given time.
Any attempt to modify one of the existing routines
necessitates trying to extract the routine, patching
up the holes in the flow of the program created by
the changes, and then fitting the modified routine
back in. Anyone who has ever tried to modify a
program written by someone else knows how difficult
it is to dissect and patch another person's logic if
the 'routines are intertwined.
U sing modular programming, each routine is a
separate entity. Your main line routine provides
the master control that ties all of your individual
processing routines together and coordinates their
activity .
Modification of routines is simplified. Further-
more, new routines may be added by simply expand-
ing the main line routine to transfer control to the
new routine in the proper sequence.
Modular Programming Conventions
Modularity is accomplished by employing the
following conventions:
1.
The main line
a. The main line routine makes all decisions
governing the flow of data to the proper
processing routines.
b. No processing routine can direct data flow
to another processing routine.

Advertisement

Table of Contents
loading

Table of Contents