Today is KWIC day, with the goal being an exploration of the tradeoffs one makes in
choosing a design
"The KWIC [Key Word In Context] index system accepts an ordered set of lines, each
line is an ordered set of words, and each word is an ordered set of characters. Any line
may be "circularly shifted" by repeatedly removing the first word and appending
it at the end of the line. The KWIC index system outputs a listing of all circular shifts
of all lines in alphabetical order."
Although KWIC is especially simple, it is still illustrative of many of the key issues
in design
Points to make (see the first Parnas paper in the readings for more details on some of
these) include
Design for change
At the very least, design decisions necessarily affect ease of change
Potential problems with straightforward top-down decomposition
Tend to optimize for speed because its an immediate reward
Influence of programming language on design (probably more than vice versa)
Specifications are tricky to write
Possible extensions and modifications of KWIC include (incomplete):
Incremental vs. monolithic sorting algorithms
Representation of lines, words, characters
Storing on disk vs. in-memory
Eliminating noise words (fixed or by choice of the user)
Interactive vs. batch (consequences?)
The attached architectural styles are from Garlan and Shaws paper