MagicDraw UML and SysML Plugin eSchool
Motto: "Learn good ways to work with MagicDraw UML and its SysML Plugin !"
About the eSchool
UML2 in MagicDraw
MagicDraw UML tips
MagicDraw SysML Plugin
MagicDraw for Java
MagicDraw for XML
Advanced UML and SysML Training

Comment vs note: where the body text is stored.

A Comment is a true UML model element with a corresponding metaclass. A Comment element - along with it's body text - is stored in the model's "repository". If you unzip your .mdzip project file you'll find <ownedComment> elements like this in XMI:

<uml:Model xmi:id='eee_1045467100313_135436_1' name='eSchool' visibility='public'>
<xmi:Extension extender='MagicDraw UML 15.1 EAP beta' extenderID='MagicDraw UML 15.1 EAP beta'>
<moduleExtension ignoredInModule='true'/>
</xmi:Extension>
<ownedComment xmi:type='uml:Comment' xmi:id='_15_1EAPbeta_41b01a5_1206031981598_738250_98' body='Author:drck.&#10;Created:21/03/08 03:53.&#10;Title:.&#10;Comment:.&#10;'>
<annotatedElement xmi:idref='eee_1045467100313_135436_1'/>
</ownedComment>
<ownedComment xmi:type='uml:Comment' xmi:id='_15_1EAPbeta_41b01a5_1206032150212_504528_254' body='What is the difference between a Comment and a Note ?'>
<annotatedElement xmi:idref='_15_1EAPbeta_41b01a5_1206032190538_630673_263'/>
<annotatedElement xmi:idref='_15_1EAPbeta_41b01a5_1206032218065_913844_302'/>
<annotatedElement xmi:idref='_15_1EAPbeta_41b01a5_1206033844150_249704_509'/>
</ownedComment>
<ownedComment xmi:type='uml:Comment' xmi:id='_15_1EAPbeta_41b01a5_1206032209466_431076_292' body='A comment can be owned by any element.'>
<annotatedElement xmi:idref='_15_1EAPbeta_41b01a5_1206032534469_292077_402'/>
</ownedComment>
<ownedComment xmi:type='uml:Comment' xmi:id='_15_1EAPbeta_41b01a5_1206032218065_913844_302' body='A Comment may carry a stereotype, like this «answer» Comment does.'>
<annotatedElement xmi:idref='_15_1EAPbeta_41b01a5_1206032315808_587036_340'/>
<annotatedElement xmi:idref='_15_1EAPbeta_41b01a5_1206033294238_506951_465'/>
</ownedComment>


In MagicDraw UML a «documentation» Comment is a special case. Although an <ownedComment> does appear in the XMI project file, the corresponding Comment can't be found in the containment browser; rather, only the owning element is shown in the browser (along with an other owned elements):

 <packagedElement xmi:type='uml:Class'
xmi:id='_15_1EAPbeta_41b01a5_1206032198918_773500_271'
name='DocumentMe' visibility='public'>
<xmi:Extension extender='MagicDraw UML 15.1 EAP beta' extenderID='MagicDraw UML 15.1 EAP beta'>
<modelExtension/>
</xmi:Extension>
<ownedComment xmi:type='uml:Comment'
xmi:id='_15_1EAPbeta_41b01a5_1206033403960_761781_475'
body='&lt;html&gt;&#10;  &lt;head&gt;&#10;   
&#10;  &lt;/head&gt;&#10; 
&lt;body&gt;&#10;    &lt;p&gt;&#10;      In
MagicDraw UML a
&amp;#160;&amp;#171;documentation&amp;#187;&amp;#160;
Comment is used to display the &#10;      documentation of an
element. Use &amp;#160;&lt;b&gt;Retrieve
Documentation&lt;/b&gt;&amp;#160; &#10;      from a
Comment attached to an Element by a handle.&#10;   
&lt;/p&gt;&#10; 
&lt;/body&gt;&#10;&lt;/html&gt;&#10;'>
<annotatedElement xmi:idref='_15_1EAPbeta_41b01a5_1206032198918_773500_271'/>
<annotatedElement xmi:idref='_15_1EAPbeta_41b01a5_1206033859779_864981_519'/>
</ownedComment>
<ownedRule xmi:type='uml:Constraint'
xmi:id='_15_1EAPbeta_41b01a5_1206035096633_538298_730'
name='constraint' visibility='public'>
<constrainedElement xmi:idref='_15_1EAPbeta_41b01a5_1206032198918_773500_271'/>
<specification xmi:type='uml:OpaqueExpression'
xmi:id='_15_1EAPbeta_41b01a5_1206035096634_102223_731'
visibility='public' body='this=that' language='OCL2.0'/>
</ownedRule>
<generalization xmi:type='uml:Generalization'
xmi:id='_15_1EAPbeta_41b01a5_1206034781959_486860_633'
general='_15_1EAPbeta_41b01a5_1206034776815_532127_610'/>
</packagedElement>



A note is not a true UML model element. In MagicDraw UML the body of a note is not stored in the model "repository". If you unzip your .mdzip project file you'll find that the note's <text> is in fact stored as a custom XMI extension:

<mdElement elementClass='Note' xmi:id='_15_1EAPbeta_41b01a5_1206034680723_700552_597'>
<elementID xmi:idref='_15_1EAPbeta_41b01a5_1206032198918_773500_271'/>
<properties>
<mdElement elementClass='ColorProperty'>
<propertyID>PEN_COLOR</propertyID>
<propertyDescriptionID>PEN_COLOR_DESCRIPTION</propertyDescriptionID>
<value xmi:value='-6711040'/>
</mdElement>
<mdElement elementClass='BooleanProperty'>
<propertyID>AUTOSIZE</propertyID>
<propertyDescriptionID>AUTOSIZE_DESCRIPTION</propertyDescriptionID>
<value xmi:value='true'/>
</mdElement>
</properties>
<geometry>560, 553, 141, 102</geometry>
<text>This note calls out Element Properties selected in the Element Properties compartment</text>
<elementProperties xmi:value='QPROP:Element:isAbstract^QPROP:Element:name'/>
<active xmi:idref='_15_1EAPbeta_41b01a5_1206034686712_886949_608'/>
</mdElement>
Search
Magicdraw eSchool Frequently Asked Questions (FAQs) about modelling