Structure Chart
Purpose
A Structure Chart (STC) depicts the interaction between software modules (procedures, functions, sub-routines, processes, or tasks). The STC is normally used to produce the implementation details for a data or control process in an Implementation Model DFD. Cradle places no restrictions on the numbering of STCs.
Example
Here is an example Structure Chart.
Description
Cradle allows STCs to exist in a hierarchy, which is an extension to the traditional application of the Yourdon methodology. The levelling of STCs finds particular application in those systems that have some degree of multi-processing or multi-tasking, where one level of STC can be used to show the inter-process and inter-task communications, while lower-level(s) show the details of each task or process.
For large systems, several levels of STC will be needed to reflect the number and complexity of the modules in the system, irrespective of whether multi-processing or multi-tasking is in use. Furthermore, the advent of packages in languages such as Ada also creates the need for more than one level of STC, where the higher-level(s) show the interactions between the package specifications (to use the Ada terminology) and lower level(s) of STC are used to define the package bodies.
The relationships between modules are shown by calls. The existence and direction of the call indicates that a module has the means to call the other module and that, at runtime, the module may call the other module zero or more times.
Typically, the STC contains a hierarchy of modules with calls used to show how one module will call another. As module calls normally involve the passage and return of parameters (or arguments), the STC depicts these with couples. Data and control couples are provided that indicate the passage or return of an item of data or some value that controls the operation of the recipient module (such as a condition for a loop or test). The orientation of the couple indicates which module is sending the parameter, and which is receiving it. For parameters which are updated by a called module, the Yourdon methodology provides the dialogue couple.
The data and control received and sent by a module in its input and output couples must be equivalent to the data and control received and sent by the collection of modules on the lower-level STC that the given module may have been expanded into.
The STC does not show sequence, so that an STC with a module M which has calls to three other modules A , B , and C drawn left-to-right below it, does not mean that M calls first A , and then B , and then C .
To avoid intersection calls, and for large systems, STCs contain named on-page connectors and off-page connectors. These objects allow calls between modules on the same or separate STCs to be shown as a pair of calls, one to the on-page or off-page connector, and the other from another on-page or off-page connector with the same name. Cradle treats calls through these connectors as though the on-page or off-page connector was not present, and the two calls were actually a single call. As such, on-page and off-page connectors are fully supported by the Consistency Checker (CC) tool and Code Generator (CGEN) tool.
This means that couples are inherited across on-page connectors and off-page connectors. For example, a couple is required between modules A and B , but the call between these modules is split using off-page connectors, only a couple from A to the off-page connector need be drawn. It is not necessary to find the STC containing B and draw another couple from this off-page connector to B .
Off-page connectors provide a useful method of splitting a large STC into several smaller and more manageable diagrams that are linked, easily traversable, and exist at the same level. This flat structure is in contrast to decomposing the large diagram into a hierarchy, which may not be appropriate as then lower-level STCs would not necessarily contain greater detail.
Any two linked off-page connectors with the same name need not exist at the same level in a hierarchy. The connectors may exist on any two STCs that have been defined within the project.
Shows call hierarchy of routines (procedures and functions) in source code. Each routine is shown by a module. Each module has a definition in the database as a module specification. Structure Charts also show the parameters passed between the routines in their calls, using symbols called couples. Each couple is defined by an entry in the Data Dictionary. Structure Charts can also show the global and shared data between these routines.
Complex diagrams can avoid calls crossing each other using on-page connectors. Off-page connectors allow calls between modules on different diagrams.
Structure Charts can be hierarchical in Cradle. Top-level Structure Charts could be used to show subsystems, with lower level diagrams used to show modules (such as source files) in a subsystem, and a bottom level of Structure Chart for the routines within a source file.
Library routines (part of an operating system, runtime kernel or application-specific library) can be shown in a Structure Chart. They do not have a definition.
Diagram Conversions
STCs can be converted into Data Flow Diagrams (STCs). To convert a DFD, select Convert Type... from the Tools menu in the Diagram Editor.
The rules for the conversion are:
-
Each STC module (of any type) becomes a DFD process.
-
All STC inter-module calls are ignored.
-
If a module is called by another but which does not have any couples associated with this call, the module's corresponding DFD process will be triggered by the corresponding process for the calling module, with a prompt control flow called TRIGGER .
-
All STC global data areas become DFD stores.
-
All STC data couples become DFD discrete data flows between the processes corresponding to the STC modules at each end of the couple. Control couples become DFD discrete control flows.
-
Each STC dialogue couple becomes a pair of discrete data flows on the DFD, each in opposite directions to the other, between the DFD processes that correspond to the STC modules linked by the couple.
Characteristics
APPEARS IN MODELS |
Implementation |
NUMBERING |
All STCs are numbered, as are the STC symbols that can be expanded into lower-level STCs. The modules on STC 1 will have numbers 1.1 , 1.2 , 1.3 , etc., which are the numbers of the STCs into which they may be expanded. Similarly, STC 1.3 modules have numbers 1.3.1 , 1.3.2 , etc. |
HIERARCHICAL |
Yes |
Linkage
Symbols
 |
Comment |
Makes a note anywhere in the diagram. Are always surrounded by * characters. |
None |
None |
 |
Boundary point |
A connection point for the initial transition to enter the initial state. |
None |
None |
 |
Module |
A module of software. |
Module Specification |
STC |
 |
Inclusion module |
A module of software that in the final source code appears within the source code of another module. |
Module Specification |
STC |
 |
Transaction centre |
A module that selectively calls one of the set of lower-level modules connected to it on the basis of some condition (it acts like an if-then-else). |
Module Specification |
STC |
 |
Library module |
A module from a library whose implementation is not defined by the project. |
None |
None |
 |
Off-page connector |
A named object that essentially breaks a single call into two calls that are on different STCs. Off-Page Connectors are associated with each other if they have the same name. The user can traverse from an Off-Page Connector on one STC to the associated Off-Page Connector on another STC at the same or a different level, directly from the diagram editor (DGE). |
None |
None |
 |
On-page connector |
A named object that essentially breaks a single call into two calls that are on the same STC. On-Page Connectors are associated with each other if they have the same name. The user can traverse from an On-Page Connector on one part of a STC to the associated On-Page Connector on another part of the STC directly from the DGE. |
None |
None |
 |
Shared data area |
A repository of data shared by one or more modules, used to represent either data common to several modules, or preserved between invocations by a single module (such as local static data in the language C), or accessed whenever invoked by a single module. |
DD Entry |
None |
 |
Global data area |
A repository of data shared by all modules that connect to it, used to represent some piece of implementation technology (software and/or hardware based) that stores information in a manner that is independent of any module using that information. |
DD Entry |
None |
 |
Picture |
Allows you to choose the location of a GIF or JPEG image to be displayed as a diagram symbol or to be embedded in an existing diagram symbol. |
None |
None |
 |
Module call |
Indicates that a module could call another module, and calls it zero or more times at runtime. |
None |
None |
 |
Module invocation |
Indicates that a module calls another module that thereafter executes in an independent manner; used for processes and tasks. |
None |
None |
 |
Iterative module call |
Indicates that one module iteratively calls another module, for example a call within a loop. |
None |
None |
 |
Data couple |
An item of data either passed to, or returned by, a module. |
DD Entry |
None |
 |
Control couple |
A control or status value or flag that affects the operation of its recipient module. |
DD Entry |
None |
 |
Dialogue couple |
An item of data passed to, and updated by, a module. |
DD Entry |
None |
 |
Function return |
An item of data returned by a module.
The Function Return symbol does not appear in the Yourdon methodology and has been added to Cradle as a supplement to it. Function Returns have no name (it is taken from the module they are returning a value from). They cannot, therefore, be named or renamed. |
DD Entry |
None |
|