Grids: A new program structuring mechanism based on layered graphs

Abstract : The structure of a computer program and the extent to which that structure is visible dramatically affect the clarity of the program. Programming languages therefore contain structuring mechanisms to provide a framework within which to structure programs. This thesis describes a new program structuring mechanism, called the grid. The grid mechanism was designed to specify, represent, document and enforce the structure of large programs having a layered organisation. Layered programs arise whenever levels of abstraction, layers of protection or multiple views of objects are used, yet they are not handled adequately by other structuring mechanisms. The structure of layered program is conveniently modeled by a layered graph consisting of interacting layers, each of which is directed graph of program parts. The grid mechanism is based on this model. A grid specification identifies the layers explicitly, and specifies program structure in terms of them. Similarities between layers are exploited to simplify a specification. Differences between layers, as well as any structural irregularities or relaxation of access restrictions, are highlighted. The grid mechanism emphasises human readability. It uses some novel techniques to specify layered graph structures in a clear and concise manner, including specification of irregular structures as regular structures with explicit deviations, omission of unnecessary detail, and localisation of information. The gird can specify multiple relationships between program parts. It also serves as a structured repository for information about a program, such as documentation or the information required by source management or version control systems.