Process-Oriented Design
4. Process Design Activities
4.6. Specify Programs
Rules for Specifying Programs
The specification documents all known information about programs. Program specifications document the program's purpose, process requirements, the logical and physical data definitions, input and output formats, screen layouts, constraints, and special processing considerations that might complicate the program. Keep in mind that the term program might also mean a module within a program or an externally called function, or even a code fragment (e.g., DB call). A program specification should include the items shown in Table 8-7. As with program packaging, there are no 'rules.' Rather there are items that should be included if they relate to the item being specified.
There are two parts to a program specification: one identifies interprogram relationships and communication, the other documents intraprogram processing that takes place within the individual program. Interfaces to other programs generally document who, what, when, where, and how communication takes place. Who identifies who initiates the communication and who, in the real world, is responsible for the interface. What identifies the message( s) content that is used for communication. When identifies the frequency and timing of the interface. Where locates the application and system in a hardware environment; where becomes complicated and is crucial to processing of distributed applications. How describes the nature of the interface-internal message, external diskette, and so forth.
Internal program processing information includes the data, processes, formats, controls, security, and constraints that define a particular program. Frequently, program specifications also include a flowchart of the program logic, a system flowchart showing the system names of the files, and a detailed specification of timing and other constraints.
Focus Code | Explanation |
---|---|
-Set &&Globalvariables -Include Security -Run -* -Mainline -Include Mainmenu -Run -If &&Choice eq 'R' goto RentRet else -If &&Choice eq 'V' goto Vidmain else -If &&Choice eq '0' goto EndOfDay else -If &&Choice eq 'Q' goto Query else -If &&Choice eq 'S' goto StopSystem else -Goto Mainmenu; -* -RentRet -Include RentRet -Run -Goto Mainline -* -Vidmain -Include Vidmain -Run -Goto Mainline -* -Custmain -Include Custmain -Run -Goto Mainline -* Query -Include Tabltalk -Run -Goto Mainline -* -EndOfDay -Include Endofday -Run -Goto Mainline -*-StopSystem -End |
Set variables needed for intermodule communication. Check password in a security module. Check password before any other processing. Comment indicator A label identifying the main routine. The call statement in Focus is 'INCLUDE.' Mainmenu is a module name. Perform Mainmenu before any other processing. Interrogate the choices from Mainmenu to decide what to do next. If in error, go back to the Mainmenu screen. RentReturn Label Call Rent/Return processing. When Rent/Ret is complete, return to the Mainmenu. Video Maintenance Label and Processing
Customer Maintenance Label and Processing Query Label and Processing End-of-Day Label and Processing Stop System Label End Processing |
FIGURE 8-32 ABC Video Processing Focus Mainline
RentRet Focus Mainline Code |
---|
-Set &&Globalvariables -*Rental and Return Processing -Crtform Line 1 -" ABC Video Rental Processing System <d.&date" -" Rentals and Returns" -"" -" Scan or enter a card or video: <&&Entry" -If &&entry like 't&' goto Return else -If &&entry like 'c&' goto Rental else -Include Entryerr; -Run -Return -Include ValidCus -Include Open Rent -Include ValidVid -Goto exit -Run -Rental -Include FirstRet -Include Open Rent -Crtform Line 15 - Do you want to do rentals? <&&Rentresp/1" -If &&Rentresp ne 'y' goto exit else -Include ValidVid -Goto exit -Run -Exit -End |
FIGURE 8-32 ABC Video Processing Focus Mainline
ABC Video Example Program Specification
The program specification for one program to perform Get Valid Customer is shown as an example (see Table 8-8). Since this is a compilation of already known information there is no discussion.
TABLE 8-7 Program Specification Contents |
---|
Identification Purpose Characteristics Reference to Applicable Documents DFD and Structure Chart (possibly also System Flowchart and Program Flowchart) Narrative of procedures in Structured English, Decision Tables, Decision Trees Automated Interface Definition Screen Interface Screen Design, Dialog Design, Error Messages Application Interface Communications Messages, Error Procedures Frequency, Format, Type, Responsible person Input, Output, and System Files Logical data design User views, internal name, graphic of physical data structure List of physical data structures Tables and Internal Data Internal name, graphic of physical data structure List of physical data structures Reports Frequency, Format, Recipients, Special processing |