Example: Simple OOM XML File

In this example, we will explore the structure of a simple OOM model file containing two classes and one association.

The file starts with several lines stating XML and model related details.

The first object to appear is the root of the model <o:RootObject Id="01">. RootObject is a model container that is defined by default whenever you create and save a model. RootObject contains a collection called Children that is made up of models.

In our example, Children contains only one model object that is defined as follows:

<o:Model Id="o2">

Below the definition of the model object, you can see the series of ModelOptions attributes. Note that ModelOptions is not restricted to the options defined in the Model Options dialog box of a model, it gathers all properties saved in a model such as intermodel generation options.

After ModelOptions, you can identify collection <c:ObjectLanguage>. This is the object language linked to the model. The second collection of the model is <c:ClassDiagrams>. This is the collection of diagrams linked to the model, in our example, there is only one diagram defined in the following paragraph:

<o:ClassDiagram Id="o4">

Like for model options, ClassDiagram definition is followed by a series of display preference attributes.

Within the ClassDiagram collection, a new collection called <c:Symbols> is found. This collection gathers all the symbols in the model diagram. The first object to be defined in collection Symbols is AssociationSymbol:

<o:AssociationSymbol Id="o5">
   <a:CenterTextOffset>(1, 1)</a:CenterTextOffset>
   <a:SourceTextOffset>(-1615, 244)</a:SourceTextOffset>
   <a:DestinationTextOffset>(974, -2)</a:DestinationTextOffset>
   <a:Rect>((-6637,-4350), (7988,1950))</a:Rect>
   <a:FontList>DISPNAME 0 Arial,8,N

AssociationSymbol contains collections <c:SourceSymbol> and <c:DestinationSymbol>. In both collections, symbols are referred to but not defined: this is because ClassSymbol does not belong to the SourceSymbol or DestinationSymbol collections.

    <o:ClassSymbol Ref="o6"/>
    <o:ClassSymbol Ref="o7"/>

The association symbols collection is followed by the<c:Symbols> collection. This collection contains the definition of both class symbols.

<o:ClassSymbol Id="o6">
   <a:Rect>((-18621,6601), (-11229,12675))</a:Rect>
   <a:FontList>ClassStereotype 0 Arial,8,N   

Collection <c:Classes> follows collection <c:Symbols>. In this collection, both classes are defined with their collections of attributes.

<o:Class Id="o10">
  <o:Attribute Id="o14">

Attribute is a terminal object: there is not further ramification required to define this object.

Each collection belonging to an analyzed object is expanded, and analyzed and the same occurs for collections within collections.

Once all objects and collections are browsed, the following markups appear: