Tags in UML XMI representation
I've got some XMI files from different UML modeling tools (Visual Paradigm, PowerDesigner, etc). Each file represents a simple UML diagram where the class B just extends the class A.
Average each file contains a code like this:
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_kkgsMBeLEd60N8ipLbB6nA" name="ObjectOrientedModel_4">
<packagedElement xmi:type="uml:Class" xmi:id="_-0_24HdHEeCkkOWu36zbRw" name="A"/>
<packagedElement xmi:type="uml:Class" xmi:id="_--YcYHdHEeCkkOWu开发者_JS百科36zbRw" name="B">
<generalization xmi:id="_-_blQHdHEeCkkOWu36zbRw" general="_-0_24HdHEeCkkOWu36zbRw"/>
</packagedElement>
</uml:Model>
I understand where uml:smth and xmi:smth are described, but I can't find out from where tags like packageElement and others were taken.
I didn't find any information in the OMG specifications before they reached this one: http://www.omg.org/spec/XMI/2.4/Beta2/, but that tags were used before creating the XMI 2.4 specification.
It also took me some time to figure it out, but packagedElement is defined in UML. So the xmi provided at OMG UML Spec v2.4.1 actually defines itself (all tags used are defined in there! -- ownedAttribute, ownedComment, packagedElement, .....)
I am just leaving this here in case someone else is wondering about it.
The xmi:id is a dynamic creation of the UML element. Like java each UML element has a single id which should remain the same during all the modeling stages. You could find more information if you read the xmi coming from the EclipseUML2 metamodel. This model is the official OMG UML 2.3 and used by many tools.
Don't forget that a good UML tool should have two files. One is graphical and could not be shared by any other tool and the other is the model and should be in xmi 2.1 format.
精彩评论