Explore the data model source code

In FML files, data models are represented using XML code. The visual representation of the model that you have created in Design mode is automatically translated to XML.

In this exercise you will explore the data model code. So far, your data model code contains the following data model definition elements:

  • model (the root element)

  • entity

  • property

  • id

  • annotation

 To switch to Source mode, at the top of the model editor, click the Source button.

Your data model should include XML code that is similar to the following entity definition:

<entity name="Meeting" persistent="true"> 
    <annotation name="ServerProperties" ServerType="LCDS" DeploymentHandler="Content"/> 
    <annotation name="VisualModeler" width="115" height="158" x="158" y="111"/> 
    <id name="ID" type="string" generated="true"/> 
    <property name="subject" type="string"/> 
    <property name="date" type="date"/> 
    <property name="time" type="string"/> 
    <property name="duration" type="integer"/> 
    <property name="note" type="string"/> 
</entity>

Notice the annotation elements below the entity element. Annotations define name-value pairs that provide additional information about data model elements. For example, the annotation with the name of VisualModeler provides information to Flash Builder for locating the meeting entity in the editor when using Design mode.

The exercises in this tutorial primarily involve Design mode. To become familiar with the XML modeling syntax, occasionally switch to source mode as you perform the exercises.