11 Stigmata introduces plug-in architecture for extracting/comparing
\r
12 birthmarks. Therefore, we can easy to install a new birthmark without
\r
13 compilation and re-build application.
\r
15 Extend points of Stigmata is as follows. Each points has service
\r
16 provider interface (SPI).
\r
18 * extract birthmark (BirthmarkExtractorSpi)
\r
20 * compare birthmarks (BirthmarkComparatorSpi)
\r
22 * birthmark (extract/compare) (BirthmarkSpi)
\r
24 * filter comparison result (ComparisonPairFilterSpi)
\r
26 * history of extracted birthmarks (ExtractedBirthmarkSpi)
\r
28 * print result (ResultPrinterSpi)
\r
32 We can implement a one or more of above spi as services in Java
\r
33 source files. Next, we archive class files which is compiled them
\r
34 into a jar file. Then, we put the jar file to the <<<plugins>>>
\r
35 directory in stigmata home directory. Finally, we restart
\r
36 application, new services will be shown.
\r
42 [images/classdiagram_birthmark.png] birthmark
\r
44 <<<BirthmarkSet>>> object represents a set of birthmarks extracted
\r
45 from a target. The target is usually class file, however, is accepted
\r
46 package, and archive (jar file). <<<Birthmark>>> interface represents
\r
47 a birthmark and includes a set of <<<BirthmarkElement>>>.
\r
52 BirthmarkSet birthmarkSet = <extracts IS and UC birthmark from TARGET>
\r
53 String name = birthmarkSet.getName(); // -> <<<TARGET>>>
\r
54 int count = birthmarkSet.getBirthmarkCount(); // -> 2
\r
55 URL location = birthmarkSet.getLocation(); // -> <location of TARGET>
\r
56 String[] types = birthmarkSet.getBirthmarkTypes(); // -> array of [ IS, UC ]
\r
57 Birthmark isBirthmark = birthmarkSet.getBirthmark("IS");
\r
58 int isCount = isBirthmark.getElementCount(); // -> element count of is birthmark
\r
59 Iterator<BirthmarkElement> isIterator = isBirthmark.iterator();
\r
61 Birthmark ucBirthmark = birthmarkSet.getBirthmark("UC");
\r
62 int ucCount = ucBirthmark.getElementCount(); // -> element count of uc birthmark
\r
63 Iterator<BirthmarkElement> ucIterator = ucBirthmark.iterator();
\r
66 *Extraction of Birthmarks
\r
68 [images/classdiagram_extraction_birthmark.png] extraction of birthmark
\r
70 <<<ExtractionResultSet>>> object represents extracted birthmarks from
\r
71 targets, and has multiple <<<BirthmarkSet>>> which is extracted each
\r
72 targets. <<<BirthmarkSet>>> has one or more <<<Birthmark>>> object.
\r
73 <<<Birthmark>>> object is constructed by <<<BirthmarkExtractor>>>
\r
76 <<<BirthmarkContext>>> means a runtime context and contains
\r
77 <<<ExtractionUnit>>> and <<<BirthmarkStoreTarget>>>.
\r
78 <<<ExtractionUnit>>> means unit of target. If <<<ExtractionUnit>>>
\r
79 object in <<<BirthmarkContext>>> is <CLASS>, then <<<BirthmarkSet>>>
\r
80 is constructed by each classes. Also, <<<ExtractionUnit>>> is
\r
81 <ARCHIVE>, then <<<BirthmarkSet>>> is constructed by each jar files.
\r
83 *Comparison of Birthmarks
\r
85 [images/classdiagram_comparison_birthmark.png] extraction of birthmark
\r
87 <<<ComparisonResultSet>>> object represents birthmark comparison
\r
88 result, and has multiple <<<ComparisonPair>>> objects which are
\r
89 comparing object between two <<<BirthmarkSet>>> objects. Then,
\r
90 <<<ComparisonPairElement>>> object represents comparing between two
\r
91 <<<Birthmark>>> objects, and this is managed by <<<ComparisonPair>>>
\r
92 objects. <<<BirthmarkComparator>>> represents a comparing algorithm
\r
93 of <<<Birthmark>>>s. Finally, <<<ComparisonMethod>>> means how to
\r
94 compare multiple <<<BirthmarkSet>>>s.
\r
96 *Filtering Comparison Result Set of Birthmarks
\r
98 [images/classdiagram_filtering_birthmark.png] Filtering ComparisonResultSet
\r
100 <<<FilteredComparisonResultSet>>> object is a concrete class of
\r
101 <<<ComparisonResultSet>>> and filtering result sequence. Filtering is
\r
102 operated based on multiple filter sets
\r
103 (<<<ComparisonPairFilterSet>>>). A filter set includes multiple
\r
104 <<<ComparisonPairFilter>>>. Examples of <<<ComparisonPairFilter>>>
\r
105 are <<<TargetNameComparisonPairFilter>>>,
\r
106 <<<BirthmarkElementCountComparisonPairFilter>>>, and
\r
107 <<<SimilarityComparisonPairFilter>>>. Each filters has
\r
108 <<<Criterion>>> object which is filter criterion.
\r
112 [images/classdiagram_services.png] Filtering ComparisonResultSet
\r