subset_gof_class: Subset GoF Classes

subset_gof_classR Documentation

Subset GoF Classes

Description

The write_gof_patterns contains not only the participation of a class in a GoF Pattern, but also the participation of methods and variables when applicable. To distinguish a row entry among class, method or variable, we must subset the role names that are associated to classes. This information can be obtained by inspecting the source code of a similar tool to pattern4 by Tsantalis.

Usage

subset_gof_class(gof_patterns)

Arguments

gof_patterns

A table of parsed GoF Patterns obtained from parse_gof_patterns.

Details

More specifically, every pattern that pattern4.jar can identify is defined as a PatternDescriptor in DPD4Eclipse/src/gr/uom/java/pattern /PatternGenerator.java (see: https://github.com/tsantalis/DPD4Eclipse).

E.g. The PatternDescriptor Decorator has rowNameList.add("Component"); rowNameList.add("Decorator"); Therefore, in the XML output by pattern4.jar, it is guaranteed when (pattern_name == "Decorator" & role_name == "Component") or (pattern_name == "Decorator" & role_name == "Decorator").

By following this process, a list of role names can be defined to subset the table to only contain classes.

Note pattern4 executes in bytecode, hence the classes are identified by their namespace. Refer to query_src_text_namespace to obtain a table to map namespace classes to filepaths.


sailuh/kaiaulu documentation built on Dec. 10, 2024, 3:14 a.m.