|Prev - Next - Down||SDMetrics - the UML design measurement tool|
<metricprocedure name="pairwise" class="com.acme.MetricProcedurePairwise" />Attribute name defines the name to denote the metric procedure in subsequent metric definitions, attribute class defines the fully qualified name of the metric procedure class.
We can then define metrics using our newly created metric procedure. Here's another example of a LCOM-style cohesion metric:
<metric name="LCOC_AttributeTypes" domain="package"> <description>The maximum number of attribute types shared by a pair of classes in a package.</description> <pairwise relation="context" target="class" sum="size(_first.AttrTypeSet * _second.AttrTypeSet)" stat="max" /> </metric>For SDMetrics to find our new metric procedure, we have to ensure that the class is included in the class path when we run SDMetrics. The simplest way to achieve this is by putting the class files in the "bin" folder of the SDMetrics installation directory. SDMetrics searches this directory for class files.
Within the "bin" directory, we have to create a structure of subfolders that reflects the packages of the classes we provide. The class file for class com.acme.MetricProcedurePairwise therefore will be located at the path bin/com/acme/MetricProcedurePairwise.class.
|Section 9.1.2 "Implementation of the Metric Procedure"||Contents||Section 9.2 "Set Procedures"|