Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach Software Engineering for Students A Programming Approach

web.firat.edu.tr
from web.firat.edu.tr More from this publisher
21.08.2013 Views

9.3 Creation of a structure chart 115 Method 3 is the same as method 2, except that we start from the input flow to the system and work out the sequence of transformations that should be applied to it. There is no definite, systematic way of drawing these diagrams. Lots of paper, pencil and erasers (or a software tool) are needed – together with a lot of creativity. Now that we have obtained the data flow diagram using one of these methods, what do we do with it? One option is to regard each bubble as a component that inputs a serial stream of data from one component and outputs a serial stream to another. Some operating systems (such as Unix) and some languages (such as the piped input and output streams facility in Java) support this “filter and pipe” software architecture. This means that we can directly implement a data flow diagram as a series of filters and pipes. However, if pipes are not available, a data flow diagram must be transformed into a structure in which components make method calls on each other. SELF-TEST QUESTION 9.1 The data flow for the log file is omitted from the above data flow diagram. Add this data flow. 9.3 ● Creation of a structure chart The first and most crucial step of data flow design is drawing the data flow diagram. Such a diagram shows the transformations and the flows of data between them. The next step is to convert the data flow diagram into a structure chart or structure diagram. A structure chart shows the components that comprise the software and how they call each other. Suppose, for example, that some software consists of three components named A, B and C. Suppose that component A calls component B and also component C. The structure chart for these components is shown in Figure 9.6. A structure chart is thus a hierarchical diagram that shows components at the higher levels calling components at lower levels. A structure chart is a tree, with one single root at the top of the chart. Notice by contrast that a data flow diagram is not hierarchical. Let us now consider the patient monitoring system and see how to convert the data flow diagram into its equivalent structure chart. In this data flow diagram, arguably the A B C Figure 9.6 Structure chart in which component A calls B and C

116 Chapter 9 ■ Data flow design central and most important bubble is the check bubble. We take this to be the main, most important component. Imagine that we can touch and move the objects within the diagram. Suppose that the bubbles are joined by pieces of string. Grasp the central component and lift it into the air. Let the other bubbles dangle beneath. Next change the bubbles into rectangles. We now have a structure chart that looks like Figure 9.7. Each box is a software component. The components communicate by calls from higher components to lower components. The data that flowed along lines in the data flow diagram is now passed as parameters to and from the various components. The check component calls the convert component which in turn calls the read data component to obtain data. Then it calls the display message component to display the output on the screen. As we have illustrated, the steps for converting a data flow diagram into a structure chart are: 1. identify the most important bubble (transformation) 2. convert this into the top-level component in the structure chart 3. allow the other components to dangle beneath the top-level component, creating a hierarchical tree 4. convert the bubbles into rectangles and the data flows into lines representing method calls. The patient monitoring example illustrates how to use the data flow design method. But the example chosen is simple and we have deliberately avoided drawing attention to complications. Data flow diagrams typically have tens of bubbles and can be quite complex. Often there are several input and output data flows. In more complex diagrams, it can be difficult to identify a single center of the diagram. Notice that although the method leads us to a structure for a piece of software that is expressed in terms of well-defined, independent components, we still have to design the detail of each and every component; we have to carry out the low-level or detailed design. This emphasizes that data flow design is a method for high-level or architectural design. convert read data check Figure 9.7 Structure chart for patient monitoring software display message

9.3 Creation of a structure chart 115<br />

Method 3 is the same as method 2, except that we start from the input flow to the<br />

system and work out the sequence of trans<strong>for</strong>mations that should be applied to it.<br />

There is no definite, systematic way of drawing these diagrams. Lots of paper, pencil<br />

and erasers (or a software tool) are needed – together with a lot of creativity.<br />

Now that we have obtained the data flow diagram using one of these methods, what<br />

do we do with it? One option is to regard each bubble as a component that inputs a<br />

serial stream of data from one component and outputs a serial stream to another. Some<br />

operating systems (such as Unix) and some languages (such as the piped input and output<br />

streams facility in Java) support this “filter and pipe” software architecture. This<br />

means that we can directly implement a data flow diagram as a series of filters and pipes.<br />

However, if pipes are not available, a data flow diagram must be trans<strong>for</strong>med into a<br />

structure in which components make method calls on each other.<br />

SELF-TEST QUESTION<br />

9.1 The data flow <strong>for</strong> the log file is omitted from the above data flow diagram.<br />

Add this data flow.<br />

9.3 ● Creation of a structure chart<br />

The first and most crucial step of data flow design is drawing the data flow diagram. Such<br />

a diagram shows the trans<strong>for</strong>mations and the flows of data between them. The next step<br />

is to convert the data flow diagram into a structure chart or structure diagram. A structure<br />

chart shows the components that comprise the software and how they call each<br />

other. Suppose, <strong>for</strong> example, that some software consists of three components named A,<br />

B and C. Suppose that component A calls component B and also component C. The<br />

structure chart <strong>for</strong> these components is shown in Figure 9.6.<br />

A structure chart is thus a hierarchical diagram that shows components at the higher<br />

levels calling components at lower levels. A structure chart is a tree, with one single root<br />

at the top of the chart. Notice by contrast that a data flow diagram is not hierarchical.<br />

Let us now consider the patient monitoring system and see how to convert the data<br />

flow diagram into its equivalent structure chart. In this data flow diagram, arguably the<br />

A<br />

B C<br />

Figure 9.6 Structure chart in which component A calls B and C

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!