Software Design Protocols
Software Design Protocols
Section 1.1 The first four questions in this section are designed to engage students in thinking
about design and their experiences with it, and consequently have no right or
wrong answers. The brief answers below are illustrative only.
1. Our environment, especially inside a building, is usually completely
manufactured, and hence thoroughly designed. Even “natural” elements, such
as plants, stones, or dirt, are selected by designers for their aesthetic or other
qualities.
2. Several apparel manufacturers sell school backpacks and book bags. These
containers are carriers for books, school supplies, computers, and other things
needed for a day at school or work. They also need to be attractive and
fashionable. The problem that their designers must solve thus has both
practical and aesthetic or marketing components.
3. Much of the plumbing in eastern Europe features narrow drains, faucets that
deliver either very hot or very cold water and nothing in between, and toilet
fixtures that subject their users to unfortunate odors. Modern plumbing is
designed to be safe and pleasant to use, and it makes life a lot nicer in many
small ways.
4. Having used both Apple and Microsoft operating systems and utilities for
many years, I can attest to the great pleasure and satisfaction I enjoy using the
former and the enormous frustration and loss of productivity I suffer from
the latter. These great differences are attributable to both the product design
(particularly of the user interface) and the engineering design of these two
product lines.
5. Details irrelevant to solving the Chicken Coop problem are that a chain link
fence is being constructed, the yard is five acres, the enclosure will hold
chickens, and it will enclose a chicken coop. The essential details are that there
is 60 feet of material and the enclosure should be of maximum size.
Details irrelevant to solving the Sheep and Wolf problem are that the
shepherdess's name is Sheila, the animals are sheep and a wolf, and they must
cross a river in a boat. The essential details are that three things must be
conveyed two at a time from one point to another, and two of them cannot be
left with the third.
6. Solving the Chicken Coop problem obviously involves considering different
sizes and shapes of enclosure. It might also take into account whether one or
more sides of the enclosure might use the chicken coop itself (though there is
not any information about the size of the chicken coop given in the problem).
Solving the Sheep and Wolf problem requires considering various sequences
of boat trips with different combinations of animals.
7. Many students will use simple drawings to model this situation. Of course, the
solution is best found using an equation to model the problem. Many students
ISED Solution Manual 1 A Discipline of Software Design 2
Section 1.4 17. An example heuristic: Work on the hardest parts of a design first.
18. An example notation: The symbolism of set theory, which uses capital letters
for sets, small letters for set elements, and symbols for the set membership,
set inclusion, and set identify relations, and the union, intersection, and
complement operations.
19. One acceptable solution:
Top level steps:
1. Open the text file and initialize counters
2. Repeat the following until the end of the file
2a. Read a line and increment the line counter
2b. Increment the word counter by the number of words in the line
2c. Increment the character counter by the number of characters
3. Close the text file
4. Report the number of lines, words, and characters
Steps to count words in a line:
1. Set the word counter to 0
2. Repeat the following until the end of the line
2a. Scan past white space
2b. If not at the end of the line, then
2b1. Increment the word counter
2b2. Scan past non-white space characters
3. Report the number of words in the line
Steps to count characters in a line:
1. Set the character counter to 0
2. Repeat the following until the end of the line
2a. Scan a character
2b. Increment the character counter
3. Report the number of characters in the line
20. The statement conflates structured design and object-oriented design.
Structured design indeed relies on top-down functional decomposition, but
not (necessarily) to develop the methods in a class (though it could be used
for this purpose). Structured design was invented before the object-oriented
paradigm was popular, and it is intended for procedural paradigm systems, not
object-oriented systems.