Skip to Main Content
The object-oriented design community has recently begun to collect so-called design patterns: cliches plus hints to their recommended use in software construction. The structural design patterns Adapter, Bridge, Composite, Decorator, and Proxy represent packaged problem/context/solution/properties descriptions to common problems in object-oriented design. Localizing instances of these patterns in existing software produced without explicit use of patterns can improve the maintainability of software. In the authors' approach, called the Pat system, design information is extracted directly from C++ header files and stored in a repository. The patterns are expressed as PROLOG rules and the design information is translated into facts. A single PROLOG query is then used to search for all patterns. They examined four applications, including the popular class libraries zApp and LEDA, with Pat. With some restrictions all pattern instances are found; the precision is about 40 percent. Since manual filtering of the output is relatively easy, they consider Pat a useful tool for discovering or recovering design information.