Contents > 8 Defining Custom Design Metrics and Rules > 8.2 Definition of Sets > 8.2.1 Projection

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"
              element="genchild" eltype="class"/>
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 projection attributes. Attribute "recurse" Attribute "set" Attribute "exclude_self" Attribute "valueset"