Contents > 8 Defining Custom Design Metrics and Rules > 8.7 Defining Metrics for Profiles > 8.7.3 XMI Serialization of Profile Extensions
8.7.3 XMI Serialization of Profile Extensions
To facilitate the tracing of system requirements, the SysML defines
requirement diagrams to represent the textual requirements of a system.
Formally, a SysML requirement is a stereotype that extends meta-class "class",
and defines two new properties "Id" and "Text" to capture a human-readable ID
and summary text of the requirement.
The following extract of an XMI file shows a SysML model with a package named
"Specifications". The package contains a requirement "XYZ" with Id "R1" and text
"The system shall do XYZ":
<xmi:XMI xmi:version="2.1" ...>
<uml:Model name = "Sample" xmi:id = "xmi1">
<packagedElement xmi:type="uml:Package" xmi:id="xmi2" name="Specifications">
<packagedElement xmi:type="uml:Class" xmi:id="xmi3" name="XYZ" />
</packagedElement>
...
</uml:Model>
<sysml:Requirement base_Class="xmi3" xmi:id="xmi7"
Text="The system shall do XYZ" Id="R1" />
</xmi:XMI>
As a consequence of the UML's lightweight extension approach,
two XML elements are needed to represent the requirement:
- A regular UML Class with the name "XYZ". This element represents the
requirement in the model.
- A SysML Requirement that references class "XYZ" via the attribute
"base_Class", and provides the values for the new properties "Id" and "Text".
This element represents the application of the "Requirement" stereotype to
class "XYZ". Note that the element is outside the model.
SDMetrics offers three options to deal with such XMI files:
- profile extensions with regular model elements
- extension references without inheritance
- extension references with inheritance
Prev |
Up |
Next |
Section 8.7.2 "Profiles in SDMetrics" | Contents | Section 8.7.4 "Profile Extensions with Regular Model Elements" |