Contents > 7 SDMetrics Metamodel and XMI Transformation Files

7 SDMetrics Metamodel and XMI Transformation Files

To define and calculate design metrics, SDMetrics needs to know what types of design elements are present in a UML design, and what are their interrelationships. The UML, standardized by the Object Management Group (OMG), has a well-defined metamodel, based on the Meta Object Facility (MOF™), also a standard of the OMG.

XMI (the XML Metadata Interchange format), yet another standard of the OMG, is a mechanism to create a textual (XML) representation of models based on the MOF, such as the UML. XMI defines a set of production rules that prescribe how to serialize the elements of a model to XML, and how to generate a DTD or schema for the XML files thus generated. However, this standard is not immediately suitable for the definition of design metrics for a number of reasons:

SDMetrics therefore uses a reduced and simplified 'metamodel for the UML'. This metamodel defines the UML elements that SDMetrics knows about, and contains all the relevant information to calculate metrics. This simplified metamodel also abstracts from the various versions of the XMI that are used to represent UML designs. To support a specific version of the XMI, we need to define a mapping of SDMetrics metamodel elements onto the XMI elements for the given version of the XMI. SDMetrics stores these mappings in "XMI transformation files".

When would I need to worry about all this?

Knowledge of the SDMetrics metamodel is needed if you want to define new metrics or rules of your own (see Section 8 "Defining Custom Design Metrics and Rules"). The metric and rule definitions make copious references to the elements and relationships defined in the metamodel.

In addition, knowledge of XMI transformation files is needed if


7.1 SDMetrics Metamodel
7.2 XMI Transformation Files