OSDN Git Service

pom.xml の macosxbundle maven2 pluginがうまく動かないので,コメントアウトした.
[stigmata/stigmata.git] / src / site / apt / developer.apt
1  ----\r
2  For developers\r
3  ----\r
4  Haruaki Tamada\r
5  ----\r
6  2007-10-26\r
7  ----\r
8 \r
9 Overview\r
10 \r
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
14 \r
15  Extend points of Stigmata is as follows.  Each points has service\r
16 provider interface (SPI).\r
17 \r
18  * extract birthmark (BirthmarkExtractorSpi)\r
19 \r
20  * compare birthmarks (BirthmarkComparatorSpi)\r
21 \r
22  * birthmark (extract/compare) (BirthmarkSpi)\r
23 \r
24  * filter comparison result (ComparisonPairFilterSpi)\r
25 \r
26  * history of extracted birthmarks (ExtractedBirthmarkSpi)\r
27 \r
28  * print result (ResultPrinterSpi)\r
29 \r
30  []\r
31 \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
37 \r
38 Class Diagrams\r
39 \r
40 *Birthmark\r
41 \r
42 [images/classdiagram_birthmark.png] birthmark\r
43 \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
48 \r
49 **Example\r
50 \r
51 ----\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
60 \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
64 ----\r
65 \r
66 *Extraction of Birthmarks\r
67 \r
68 [images/classdiagram_extraction_birthmark.png] extraction of birthmark\r
69 \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
74 object.\r
75 \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
82 \r
83 *Comparison of Birthmarks\r
84 \r
85 [images/classdiagram_comparison_birthmark.png] extraction of birthmark\r
86 \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
95 \r
96 *Filtering Comparison Result Set of Birthmarks\r
97 \r
98 [images/classdiagram_filtering_birthmark.png] Filtering ComparisonResultSet\r
99 \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
109 \r
110 *Services\r
111 \r
112 [images/classdiagram_services.png] Filtering ComparisonResultSet\r
113 \r
114 \r