Contents > 8 Defining Custom Design Metrics and Rules > 8.2 Definition of Sets > 8.2.1 Projection
We have already seen how projections work for the definition of
metrics (Section 8.1.1 "Projection"). The definition of sets via projections
works almost the same way. For example, an element set containing the
child classes of a class can be defined as follows:
<set name="Children" domain="class">
<description>The set of children of the class.</description>
<projection relation="genparent" target="generalization"
The following example defines a multiset containing the supplier
classes to which a class has a dependency link. If a class has
multiple dependency links to the same supplier class, that supplier
class will occur multiple times in the resulting set.
<set name="SuppClasses" domain="class" multiset="true">
<description>The supplier classes of which the class
is a client in a dependency.</description>
<projection relation="depclient" target="dependency"
element="depsupplier" eltype="class" />
The following attributes we know from projections for metrics (see
Section 8.1.1 "Projection") are also available for set projections:
In the remainder of this section, we describe set projection
attributes that are new or have changed meanings from the metric
- relation: name of the relation that contains the elements to include
in the set
- relset: a set expression defining the elements of the
set. Exactly one of the attributes relation or relset must be
- target: element type(s) of related elements
- element: for relations with an indirection, relation
links to follow
- eltype: for relations with an indirection, type(s) of
indirectly related element
- targetcondition and condition: reduce set to
elements which fulfill the specified expression
- scope: reduce set to elements which fulfill a scope
condition in relation to the element for which the set is defined
220.127.116.11 Attribute "recurse"
18.104.22.168 Attribute "set"
22.214.171.124 Attribute "exclude_self"
126.96.36.199 Attribute "valueset"
|Section 8.2 "Definition of Sets"||Contents||Section 188.8.131.52 "Attribute "recurse""|