• No results found

How It All Works

76 Chap. 7 The Design Phase

design walk-through. At least one week before the walk-through give the attendees copies of and all with the list of advantages and disadvantages for each one. Tell them that the purpose of the meeting is to choose the best TLD. This will be done by 'walking through', step by step, each suggested design, ensuring that the list of trade-offs is correct. Everyone should be encouraged to suggest alternative designs, as well as additional trade-offs that the authors may have overlooked. Let each person on the walk-through team know that they are-as a team-responsible for determining the best design.

walk-throughs (and later when we discuss lower level design, documenta- tion and program walk-throughs) can be extremely valuable if the following rule is obeyed: "LEAVE YOUR EGOS OUTSIDE." (This was the sign on the door of the studio when the songs "We are the World" and "Tears are not Enough" were recorded.) The idea is not to point out faults in the designer, nor is it an opportunity for the attendee to prove that he could do it better. The designer must also be aware that all criticism is constructive-he must not get defensive. The objective is to find all problems, suggest alternatives and make the best possible choice. Some people suggest that managers not be invited to walk-throughs. Managers can inhibit the free flow of ideas and discussions.

7.5 MEDIUM

LEVEL

DESIGN

After the is chosen, you must break each major function or component down to the sub-functions or components. Let us see how this could be done for the Amalgamated Basketweaving Company system. Begin by assigning a number to each major compo- nent on the TLD.

FILE HANDLER

7.4 Numbering system for the TLD

7.5 Medium Level Design

Top down design dictated that the break down must begin with the MENU box. Let assume that this component is called when the whole system is started and it presents the following 'main' menu to the registrar.

M A I N MENU

1. INQUIRE ON A

2 . UPDATE DATA

3. REGISTER STUDENT 4. WAREHOUSE

5. REPORTS 6 . QUIT

USE ARROW TO HILITE YOUR CHOICE THEN PRESS RETURN,

OR MOVE MOUSE TO H I L I T E YOUR CHOICE, THEN PUSH BUTTON ON MOUSE

PRESS HELP KEY TO GET HELP ON HILITED ITEM

J

Then the program waits for the user to move the mouse. major sub-functions of the MENU component can be:

1. Start the system up and present the main menu.

2. Handle movement of the mouse.

3. Handle the button on the mouse.

4. Go to INQUIRE, UPDATE, WAREHOUSE or REPORT when chosen.

5. Handle errors as well as on-line help messages for the whole system.

6. Shut down system if is chosen.

The next level of breakout diagram (or structure diagram) for the nent could look like this:

START DRAG CLICK ACTION ERROR

Figure 7.5 Second level of breakout

78 Chap. 7 The Design Phase The third level of breakout can be seen in Appendix A-Design Specification. You may consider breaking it down even further. Remember, you go down to a level from which the programmers can start module breakdown and programming. The lowest level boxes represent modules. A module is the smallest testable, compilable piece. See Section for what constitutes a good module.

Note that on the structure diagrams (Appendix A) we control flow: solid lines show module calls. We can also show data flows: the dotted arrows show the parameters direction of the arrow shows the direction of the data movement.

Naming Conventions

Modules are named to indicate system, function, or subfunction as necessary (See Appendix A, Design Specification, Section 6 for the system modulenaming). For languages where more characters arepermitted, establisha detailednaming system that clearly indicates the function of both modules and variables. Do not try to save paper by shortening names to obscure acronyms.

Numbering Conventions

The number on each box is constructed as follows: On each lower level add a dot plus an integer to the number of the box above. The integer can be sequenced left to right.

The number shows the path down the break out tree, as well as the level at which the box is found.

7.6 DESIGN DICTIONARIES Module Dictionaries

As you progress through the design, build the following three dictionaries:

Dictionary 1. Numerically ordered by component number, gives the routine name and a short description for every module. For example:

0.0 AOOOOOOO Amalgamated Basketweaving System 1.0 Menu system

1.1 AMSTOOOO Startup, disp first menu, shutdown etc.

Dictionary 2. Alphabetically ordered by component name, gives the routine number and a short description for every module. For example:

AOOOOOOO 0.0 Amalgamated Basketweaving System AMOOOOOO 1.0 Menu system

AMSTOOOO 1.1 Startup, disp first menu, shutdown

This can easily be created from Dictionary 1 using a sort program.

7.7 Structured Modules, or How Far Do You Break It Up? 79 Dictionary 3. Alphabetically ordered by the short description, gives component number and the routine name. For example:

Amalgamated Basketweaving System 0.0

Menu system 1.0 AM000000

Startup, disp first menu, shutdown 1.1 AMSTOOOO

This can also be created from Dictionary 1 using a sort program. You can use these dictionaries during design, programming, or subsequent testing and

anytime you need to find a module, its calls or its parameters.

The (Common) Data Dictionary (CDD)

List in alphabetical order all the parameters that are shown on the data flow arrows. For each item list the type, length, restrictions and the modules that use it. This CDD will later contain all other parameters defined in lower levels of design and programming, as well as the fields defined in files. The CDD ensures that the parameters will be consistent throughout the whole system. Some operating systems such as

provide a Common Data Dictionary.

7.7 STRUCTURED MODULES,