Source Code Transformation based on Architecture Implementation Patterns
Autori
Viac o knihe
This thesis introduces a semi-automatic source code transformation approach in the context of pattern-based software reference architectures. For automatic processing of patterns, a pattern language for Architecture Implementation (AIM) patterns is developed focusing on structural patterns. The pattern language integrates code templates into the pattern description specifying a standardized reference implementation of a pattern’s solution. The source code transformation approach takes a source AIM pattern and a target AIM pattern as inputs. The detection of a source AIM pattern as a first step towards the source code transformation requires a combined template language of a meta language and an object language implemented in a grammar transformation approach. The meta language states the language to describe the gaps of a cloze, whereas the object language describes the language a template instantiation results in. Given the combined language, templates and application code can be parsed to build concrete syntax forests. The pattern detection approach built as part of this thesis implements a tree matching algorithm based on path matching with wildcards. Based on extracted information from matched wildcards the target AIM pattern specification can be used to generate source code. An incremental code generation approach is presented, which enables source code generation based on AIM patterns weaving newly generated code into existing code.