374 ◾ Appendix C
multiple switch statements must be updated with the option of initializing
the function pointer to hold the address of the appropriate function for the
new subtype. Clearly, maintenance is then tedious. Why is it error-prone?
It is usually not a trivial task to nd all relevant switch statements, espe-
cially if the library system is large and distributed across many modules.
C.2.2 Pass #2: Struct Ties Together Data and Functionality
Our second pass attempts to reduce the soware complexity of the ini-
tial design by tying together data type and functionality. As shown in
Example C4, the LibItem struct denes library item data as well as the
renewal function pointer. Functional decomposition is explicit. e pre-
ProcessRenewal ...