Article Preview
Top2. Recovering Design Pattern Instances
The Multiple Levels Detection Approach (MLDA) is a research prototype, which has been developed to recover the instances of design patterns from Java source code. MLDA involves three main levels: a parsing level, a searching level and method signatures matching level. The architecture of MLDA appears in Figure 1.
The parsing level aims to recover the source code information and produce a source code model. Moreover, MLDA aims to recover the five key relationships, which may occur between classes and objects inside any object-oriented program. These relationships are Inheritance, Aggregation, Association, Dependency and Realization. On the other hand, the searching level of MLDA aims to examine the source code model that has been developed during the parsing level and tries to match it with the GoF’s catalog.
Specifically, MLDA introduces a Structural Search Model (SSM), which involves a searching algorithm for each design pattern. MLDA works on the principle of building the patterns incrementally based on the connecting relationships. The third level of MLDA is the method signatures matching level. The method signatures of the subject system are represented as a set of facts. On the other hand, the required method signatures of the candidate design instances are represented as a set of rules. CLIPS (C Language Integrated Production System) (Clipsrules.net, 2017), an expert system tool, has been used to match the generated facts and rules. It must be noticed that MLDA uses the standard codes presented by GoF (Gamma et al., 1995).