Data Flow and Control Flow
For years, data flow and control flow were seen as the primary means to document a software system. Although modern software architecture principles have evolved into the more general study of structures and behavior, these two venerable aspects of softwaredata and controlrule the day in a few pockets of practice. How do they relate to what we would call a more holistic architecture documentation package?
11.7.1 Data Flow Views
Data flow views of a system are exemplified by data flow diagrams (DFDs), a concept made famous by the structured analysis methods of the 1970s. If your intent is to represent data flows as described earlier, you should choose a style in the C&C viewtype. This viewtype lets you define components for data processing and for data stores. A connector in a C&C view describes an interaction or a protocol between components but usually not the data that flows across the connector. Therefore, to represent data flow diagrams, define a C&C style in which components are proceduresprocessesand/or data stores, and the connector is a "data exchange" connector with the additional property of names of data flows. Table 11.13 shows how to represent data flow diagrams in the C&C viewtype.
Data Flow Diagram Term | Our Term | |
---|---|---|
Components | Procedure | Component: functionality |
Data store | Component: data store | |
Connectors | Data exchange | Communication + data flow name |
You may also want to describe data flow aspects of modules represented in a style of the module viewtype. To document data type dependencies, you can show which modules are producers or consumers of a specific data type. Representing data flow in a module viewtype is done by defining a style specializing the depends-on relation into a sends-data-to relation. In case it is of interest, data stores can be defined as a specialized type of module. Table 11.14 shows how to represent data flow diagrams in the module viewtype.
Data Flow Diagram Term | Our Term | |
---|---|---|
Element | Procedure | Module |
Data store | Specialized module as data store | |
Relation | Data flow | Sends-data-to, specialized from depends-on |
The allocation viewtype also has the potential to document data flow aspects, especially if analyzing network or storage capacities is important. Such a diagram would represent how much information flows at a time over a network connection or how many megabytes are required for either persistent or temporary storage. Table 11.15 shows how to represent data flow diagrams in the allocation viewtype.
Data Flow Diagram Term | Our Term | |
---|---|---|
Software element | Procedure | Process |
Data store | Specialized module as data store | |
Environmental element | Processor | Physical unit: data store |
Data storage | Physical unit: processor | |
Relation | Data flow | Sends-data-to |
Communication channel | Communication |
Finally, note that DFDs don't make the strong distinction among modules, components, and hardware platforms that more modern treatments of architecture do. So if your goal is to reproduce the classic data flow diagrams of structured-analysis fame, you may have to define a hybrid style that combines the module, C&C, and allocation styles. Data dictionaries, a strong part of DFD method, have their counterpart in the element catalogs described in Chapter 10. P-specs, which are essentially pseudocode representations of the elements, can be captured as behavioral information in our world.
If you are a diehard member of the DFD community, take comfort in the fact that you can achieve your goals with the methods of this book. But heed the advice given for the other documentation approaches in this chapter: Augment your favorite with other useful views; then complete the package by adding supporting documentation and beyond view documentation.
11.7.2 Control Flow Views
Whereas a data flow diagram portrays a system from the point of view of the data, a control flow graph, such as a flowchart, portrays the functionality that performs transformation on the data. In Chapter 8, we introduced several modeling languages, some of which have flowchartlike control symbols, such as decisions and loops. Therefore, if flowcharts are part of your system documentation and you are looking for a place to put them in a documentation package prescribed, you can regard them as a form of behavioral documentation and use them in conjunction with any viewtype. In some casesfor example, to support performance analysis or to build in an aid for later debugginga control flow notation in the primary presentation of a view might be of interest.
In a C&C style, the use of a specific connector defines a control flow, or interaction, between the connected components. (See Table 11.16.) In a module viewtype, control flows would be represented as a uses relation specialized into a transfers-control relation. (See Table 11.17.) In a deployment viewtype, the change of control in the execution environment can be represented. Performance, security, and availability analyses that include the execution platform rely on understanding the flow of control within the system. (See Table 11.18.)
The flow chart is a most thoroughly oversold piece of program documentation. . . . The detailed blow-by-blow flow chart . . . is an absolute nuisance, suitable only for initiating beginners into algorithmic thinking. (F. P. Brooks 1995, p. 167) |
Thus, classic flowcharts, which detail the behavior of programs, can be used as a way to specify the behavior of elements, although many other, more suitable languages are available to do that. At coarser levels of granularity, however, it might make sense to show control flow among architectural elements as a view in its own right, but be clear on the expected use of such a view. Views based on other styles might do the same job and convey richer information as well.
Control Flow Diagram Term | Our Term | |
---|---|---|
Components | Procedure | Component: process |
Connectors | Control flow | Connector |
Control Flow Diagram Term | Our Term | |
---|---|---|
Element | Procedure: process | Module |
Relation | Control flow | Transfers-control-to specialized from uses |
Control Flow Diagram Term | Our Term | |
---|---|---|
Software element | Procedure: process | Process |
Environmental element | Physical unit | |
Relation | Control flow | Communication specialized to control flow |