Hello,
XMI is a (in fact it’s not, but that is actually the mess) standard defined by the OMG for the exchange of models between tools.
Steven Kelly of MetaCase has written a blog posting concerning XMI. Basically, he claims that XMI is mostly unusable and its popularity is declining according to google.
The major causes for this unfortunate state of XMI are:
- The OMG hugely over engineered the XMI standard. The XMI specification is based on the MOF and thus introduced an additional level of abstraction.
- The OMG specified a couple of different versions, each requiring its own processing. The different version where driven by the associated UML versions.
- The OMG failed in providing a compliance test suite for XMI. Although they had plans to do this these plans where never realized.
- The vendors are also sometimes accused to actively try to “lock in” their customers to their own tool by making the XMI export proprietary. But on the other side this means that they cannot read XMI files from other tools thus losing possible customers. Personally I think that most vendors did not actively try to make their XMI format proprietary but that they just misinterpreted the XMI specification or that they did not want to spend the required effort to provide a fully compliant XMI format.
In practice, this means that a tool that wants to properly import XMI must write a dedicated importer for each supported other tool and for at least one of the XMI versions that are supported by the other tool.
In addition of being massively incompatible, the XMI files in itself are also often really freaky.
Lets look at an example in MagicDraw. Suppose we want to specify the type of an attribute as Boolean. The UML supports this as a builtin primitive type and thus one could assume that the representation in XMI should be straight forward. Not so with MagicDraw. If you open the dialog for the attribute type and click in the “type” field you are presented with the preselection “$OCL_boolean” and you could be tempted to use this suggestions, especially when you want to use the OCL:

If you resist this temptation and start to type “boo” MagicDraw offers these choices:

While the second choice is probably the better one, as a tool vendor you would have to support both forms since certainly some users would choose the first form.
Now let’s look how these different forms are represented in the XMI.
$OCL_Boolean:
<ownedAttribute xmi:type='uml:Property' xmi:id='_15_0_1_275013a_1210362988887_907256_342' name='underAge' visibility='public'>
<type xmi:type='uml:PrimitiveType'
href='UML_Standard_Profile.xml#_12_0EAPbeta_f720368_1161801304327_563815_114>
<xmi:Extension extender='MagicDraw UML 15.0' extenderID='MagicDraw UML 15.0>
<referenceExtension referentPath='UML Standard Profile::Validation Profile::OCL Library::$OCL_Boolean' referentType='PrimitiveType'/>
</xmi:Extension>
</type>
</ownedAttribute>
boolean from the MagicDraw profile:
<ownedAttribute xmi:type='uml:Property' xmi:id='_15_0_1_275013a_1210362988887_907256_342' name='underAge' visibility='public'>
<type xmi:type='uml:DataType' href='UML_Standard_Profile.xml#eee_1045467100323_191782_59'>
<xmi:Extension extender='MagicDraw UML 15.0' extenderID='MagicDraw UML 15.0'>
<referenceExtension referentPath='UML Standard Profile::MagicDraw Profile::datatypes::boolean' referentType='DataType'/>;
</xmi:Extension>
</type>
</ownedAttribute>
Boolean from the UML PrimitivTypes package:
<ownedAttribute xmi:type='uml:Property' xmi:id='_15_0_1_275013a_1210591343275_118710_1237' name='ended' visibility='public'>
<type xmi:type='uml:PrimitiveType' href='http://schema.omg.org/spec/UML/2.0/uml.xml#Boolean'>
<xmi:Extension extender='MagicDraw UML 15.0' extenderID='MagicDraw UML 15.0'>
<referenceExtension referentPath='UML Standard Profile::UML2 Metamodel::AuxiliaryConstructs::PrimitiveTypes::Boolean' referentType='PrimitiveType'/>
</xmi:Extension>
</type>
</ownedAttribute>
Now this is not a problem of XMI in itself but an incapability of the vendor to hide implementation details from the user. But it is typical for the problems that arise during processing XMI files.
Best regards,
Andreas
Technorati Tags: UML, XMI, MagicDraw