Systems Analysis & Design: Topic 10b
- a collection of functions that act on the same object, i.e., a continuous set of statements that performs a specific task.
- can be labeled in two ways:
- 1, 1.1, 1.2, etc., with the number to the right of the decimal point signifying that those modules are subsets of module 1.
- 100, 110, and 120, which allows the insertion of subordinate modules using a number between 110 and 120.
- a vector joining two modules, going from the calling module (supervisor) to the called module (subordinate).
- each points downward since the structure chart is hierarchical, with the supervisor higher than its subordinates.
- implies that there is an unconditional return to the supervisor when the subordinate terminates.
- with or without arrowhead.
- indicates iteration or looping when attached to a module.
- indicates that some of the subordinate modules will be repeated until they are finished.
- see the final figure in these notes for an example.
- indicates selection or conditional when attached to the bottom of a module.
- signifies that only some of the modules below the diamond will be performed.
- The diamond does not indicate which modules will be selected, and the loop does not indicate which modules will be repeated. They are meant to be general, not specific. Both can be made more specific by restricting the drawing.
Types of Modules
Control modules, or dispatchers
- usually found near the top of the structure chart and contain the logic for performing the lower-level modules.
- includes statements such as IF, PERFORM, and DO.
- includes few detailed statements such as ADD and MOVE.
- should not be very large in size since control logic is usually the most difficult to design.
- limited to seven to nine subordinate modules; if more are needed then additional control modules should be introduced that are subordinate to the original control module.
- logic may require a decision tree or decision table.
- are those derived from the DFD.
- usually perform only one task, although several secondary tasks may be associated with the primary task.
- Example: PRINT TOTAL LINE.
- usually have mixed statements, a few IF and PERFORM or DO statements, and many detailed statements such as MOVE, ADD, etc.
- are lower in the structure than control modules.
- are the lowest in the structure, with a rare subordinate module below them.
- perform only one task, such as formatting, reading, etc.
- some of these modules can be found on the DFD, but in many cases they have to be provided.
Types of Connections
- represented by an arrow with an empty circle.
- represents a data item that moves from one module to another.
- all shared or passed data must appear as a couple; one connection may have several couples; and each couple must be entered in the data dictionary.
- A module should receive only the data necessary to complete its task.
Switch (or flag)
- represented by an arrow with a filled-in circle.
- represents a specific type of couple that is set and tested in order to communicate information about some condition or other data item.
- Couples and flags should be kept to a minimum in order to enhance modifiability.
- While control is intended to return from lower-level modules to those higher in the structure, it may sometimes be necessary to pass control downward in the structure.
- If a flag is used for this purpose it indicates that a lower-level module is making a decision, resulting in a module that is performing two separate tasks, which is a violation of the ideal functional module -- one that performs a single task only.
- The figure below demonstrates this situation, and the one following shows the solution.
Drawing A Structure Chart
Use of DFD
- In order to draw a structure chart it is best to begin with the data flow diagram, because the DFD provides the processes which will become modules.
- Since the DFD is intended to be a logical representation of the system, it is reasonable that the modules derived from the diagram are the same. (This also underscores the importance of designing a good DFD.)
- The main process shown on the context diagram corresponds to the main process on the top of the chart, and represents the module that controls everything underneath.
- The processes on Diagram 0 of the DFD provide the modules on the second level of the structure chart.
- The modules on the second level will control the operations of the modules on the third level.
- The data flows on the DFD become the data couples on the structure chart.
- The DFD indicates the sequence of the modules in a structure chart. If one process provides input to another process, the corresponding modules must be performed in the same sequence.
- If a process explodes to a child data flow diagram, the module corresponding to the parent process will have subordinate modules that correspond to the processes found on the child diagram.
- The following figure shows the Level 0 DFD of a payroll system with four processes, two data stores, and several data flows.
- The following figure shows the structure chart.
- The main process at the top of the chart corresponds to the process shown in the context diagram, and represents the module that controls everything underneath.
- The modules on the second level have the same names and perform the same processes shown in the DFD.
- These third level modules accomplish the functions necessary to perform each calling routine.
- Each module performs only one function, which is the ideal case. In this example the data couples and flags are kept to a minimum.
- The symmetry shown in the example is not required.