5.2.2.2. Object

The element <object> defines a data entity in the data model and lives within the scope its parent package. The model can potentially contain a multitude of packages, each with their set of child objects. The objects can be equipped with attributes that refer to standard Java types such as String, Boolean, LocalDate etc., while references point to other objects that are defined in the same model package. Like its parent package and children attributes/references, an object can contain metadata that patterns can use in their logic.

An example is shown below.

Listing 5.15 <Object> example
 1<model>
 2        ...
 3        <package name="yourModelPackage">
 4                ...
 5                <object name="yourObjectName01">
 6                        0 or more <properties></properties>
 7                        0 or more <reference name="yourReferenceName" type="typeOfYourReference" multiplicity="0..n"></reference>
 8                        0 or more <attribute name="yourAttribute01"></attribute>
 9                        ...
10                </object>
11                ...
12        </package>
13        ...
14</model>

Object Attributes

Table 5.16 attributes of <Object/>

Name

Details

Required

name

Name of the object in the package “yourModelPackage” of the MetaFactory model (model.xml). This name “yourObjectName01” has to be unique.

Mandatory

Object Sub elements

Table 5.17 <Object/> sub elements

Name

Details

Number

metadata

With the metadata of an object the code instruction logic can make decisions or it can itself add metadata to the object.

0 .. n

reference

The reference points to another object and specifies the type of relationship with that object (e.g. notnull and multiplicity)

0 .. n

attribute

Attributes refer to standard object types, e.g. String, Boolean, LocalDate etc.

0 .. n