Sysmod
|
Example Model
|
In the following example we see many of the features of sysmod. There are essentially
two kinds of object, a dataobject and a enumobject. A dataobject is an object which is
perisited to the database, while an enumobject is essentially a hard coded list. A
enumobject is useful for times where you need selection lists, but do not want to write
a table and some kind of maintain for a trivial lookup. Most of your model will therefore
be dataobjects.
<model name="demo">
<description>
Welcome to sysmod, a fairly simplistic multi language XML modeling tool/code generator.
Sysmod allows the developer to easily specify an applications business model in a clean,
unobtrusive XML file.
</description>
<dataobject name="Person">
<property name="firstname" type="String" searchable="yes" required="yes"/>
<property name="surname" type="String"/>
<linkto name="Dog" type="Dog"/>
<child name="Freckles" type="Freckle"/>
<enum name="Gender" type="Gender"/>
</dataobject>
<dataobject name="Dog">
<property name="Name" type="String" searchable="yes"/>
</dataobject>
<dataobject name="Freckle">
<property name="Location" type="String" searchable="yes"/>
</dataobject>
<enumobject name="Gender">
<property name="Male" value="0"/>
<property name="Female" value="1"/>
<property name="Neither" value="2"/>
</enumobject>
</model>
|
Tag |
Attribute |
Description |
model | name | The name of the model. |
description | | There can be a description under a model or dataobject.
In the case of a dataobject the comments will be included inside the source code. |
dataobject | name | Name of the dataobject. This is used to form class names. |
property | name | Name of the property. This is used to form set and get methods for the property. |
property | type | The type can be Interger, Float, String, Date. |
property | searchable | Should the generator create methods to search on this field? |
property | required | Shall the class ensure that records are not saved unless this field is not empty? |
|
|