.. ******************************************************************************* * MetaFactory.io R2 * Technical Documentation * * File name : ModRef_Reference.rst * Created by : Marnix Bochove (original text) * Last update : 24-03-2021 * Updated by : Niels de Nies * * MetaFactory BV Amsterdam ******************************************************************************* .. include:: /inline-images.txt Reference ========= is a sub element of :ref:`object ` and defines a relation with another object in the same package. Inside this object scope the name of the reference has to be unique. An object can contain any number of references. .. code-block:: xml :caption: example :name: MR-reference-01 :linenos: :emphasize-lines: 8 ... ... ... ... .. rubric:: Syntax .. code-block:: xml .. rubric:: Attributes .. list-table:: **attributes of ** :widths: 15 70 15 :header-rows: 1 :class: tight-table * - Name - Details - Required * - name - Name of the reference – has to be unique within the context of the object it is defined in. - mandatory * - type - Data type of this reference (integer, boolean, string, other object…) - mandatory * - multiplicity - Sets the multiplicity of the relation between the object of the reference and the object referred to. multiplicity=”0..1| 1..1| 0..n| 1..n| n..n” - mandatory * - notnull - This flag attribute tells whether its reference is allowed to be undefined (notnull=’FALSE”) or not (notnull=”TRUE”). notnull=”false|true” with default “false” - optional Exxample from the Bookstore application: an Author has a reference to Book, and the Book has references to Author and Category. .. code-block:: xml :caption: example :name: MR-reference-02 :linenos: :emphasize-lines: 10, 18-20, 25 .. rubric:: Sub elements .. list-table:: sub elements :widths: 15 70 15 :header-rows: 1 :class: tight-table * - Name - Details - Number * - :ref:`metadata ` - This element can contain properties that are specific to the package. - 0..n