Prev - Next - Down | SDMetrics - the UML design measurement tool |
UML 1.x
To allow a model element e to violate a rule named rulename, define a tagged value for e, where the tag name is violates_rulename (please refer to the manual of your UML modeling tool for details on how to add tagged values). The value of the tagged value pair is ignored by SDMetrics. You can use the value for instance to document the reason why the model element is allowed to violate the rule.
For example, if after a design review a particular class is allowed to violate rules named "GodClass" and "MultipleInheritance", you add two tagged values to the class, one with tag violates_GodClass and the other with the tag violates_MultipleInheritance. From then on, violations of these two rules will no longer be reported for that class (and only these two rules, and only for that class).
UML 2.x
UML 2 no longer has tagged values as they are known in UML 1.x, but
every model element can own comments. To exempt a model element from
one or more rules, add one or more comments where the body text
contains the string violates_rulename for each rule the model
element is allowed to violate. Please refer to the manual of your UML
modeling tool for details on how to add comments. An example comment
body text could be:
"violates_GodClass, violates_MultipleInheritance: confirmed in
review"
The comment's body can contain additional text before, after, or between the violates_rulename tags. You can use this to document the reason why the model element is allowed to violate the rule.
Customizing rule exemption annotations
If the above methods to mark elements as exempt from certain rules do not suit you, the method is customizable to some degree, see Section 8.3.6 "Exempting Approved Rule Violations".
Prev | Up | Next |
Section 4.7.1 "Filtering Design Rules" | Contents | Section 4.8 "The View 'Descriptive Statistics'" |