Contents > 8 Defining Custom Design Metrics and Rules > 8.2 Definition of Sets > 8.2.1 Projection > 22.214.171.124 Attribute "set"
126.96.36.199 Attribute "set"
The set attribute is the set counterpart of the sum
attribute for metrics. If you specify a set expression using the
set attribute, the set expression is evaluated for each
element in the projection, and the union over all these sets is
In the following example, we assume we have defined two sets for
We can then define, for a package, the set of classes that have an
association or dependency link with a class in the package:
- "AssCls" - the set of classes that have an association with the
- "DepCls" - the set of class that have a dependency (client or
supplier) with the given class
<set name="AssCls" domain="package">
<projection relation="context" target="class"
The sets referenced in the set expression may be either all
element sets, or all value sets (see also Section 188.8.131.52 "Attribute "valueset""). The
resulting set will be of the same type as the constituent sets.
|Section 184.108.40.206 "Attribute "recurse""||Contents||Section 220.127.116.11 "Attribute "exclude_self""|