| OCR Text |
Show 48 fly or to obtain an equal amount of information about simulation's behavior. 3.2.7 Software Modularization Often a computer program must be expanded, but new requirements do not fit well into the existing program. This is especially the case when the new requirements do not change the program, but request information about the behavior of the program. For example, we are interested in statistics of the execution behavior of an implementation of an abstract data type (ADT). To collect the statistics, the changes must be made in all ADT routines and in the main program which performs initialization and postprocessing of results. The statistics code is thus not collected at one place, but it is interspersed at many different places. For someone who is not familiar with the program, it is hard to locate and to understand this code. An additional problem is that the ADT routines have become larger and more complex, although the statistics code is not directly related to the tasks they perform. At the core of this problem is the inability of processes to get information about dynamic behavior of other processes. Introspection provides mechanisms to put the code about statistics together in one director and trigger the execution of its parts depending on the execution of ADT routines. There is no need to change code in the ADT routines. An example of a director to collect statistics about memory allocation is shown in Figure 3.7. This example outlines a new approach to software partitioning. Usually, the basic criterion for the software modularization is information hiding, called a black box approach. It stems from a position which treats computations as a static piece of program code. Since all activities must fit into a single execution stream, black boxes do not provide enough degrees of freedom to incorporate features requesting information about the process behavior. |