| Prev - Next - Down | SDMetrics - the UML design measurement tool |
We already know the compare procedure for metrics (see Section 8.1.8 "Element Comparisons"); the attributes and their evaluation are the same, except the report_element attribute is not allowed.
In the context of sets, the compare procedure returns the set of elements that match the comparison criterion specified in the comp expression. For example, the following definition yields the set of "sibling" classes of a class. These are classes with a common ancestor, but that do not inherit from each other.
<set name="Siblings" domain="class"> <description>The set of sibling classes of a class.</description> <compare target="class" comp="term->with.AncSet=0 and with->term.AncSet=0 and size(term.AncSet*with.AncSet)>0" /> </set>In the example, "AncSet" is the set of ancestors of a class. The comp expression specifies that the current class must not be the ancestor of the other class or vice versa, and the intersection of both classes' ancestor sets must not be empty.
| Prev | Up | Next |
| Section 8.2.2 "Subelements" | Contents | Section 8.3 "Definition of Design Rules" |