.. ******************************************************************************* * MetaFactory.io R2 * Technical Documentation * * File name : ModRef_Index.rst * Created by : Marnix Bochove (original text) * Updated by : Niels de Nies * * MetaFactory BV Amsterdam ******************************************************************************* .. include:: /inline-images.txt .. include:: /metadata_include.txt Model Reference =============== MetaFactory supports both XML (recommended) and YAML to contain the model data. This document describes the required structure of the file and its child elements. |Glasses M| To learn more on how to access and manipulate this file from within your code instructions, please check the :ref:`Model API reference `. Model structure --------------- The MetaFactory model file contains a ‘model’ element as root, which has one or more packages that are used to group data :ref:`objects ` (entities). Every object can have attributes and references to other objects inside the model, which is equivalent in functionality to Java’s entity properties. By using the model and code instructions, MetaFactory is able to generate (‘to MetaFactor’) the code for all the entities of the model. While executing code instructions MetaFactory reads the model by iterating through the element hierarchy. During these iterations the code instructions and model data are combined to create the actual output code. The hierarchy of the model data file is fixed and looks as follows in XML, which file would be 'model.xml'. .. code-block:: xml :name: Model-structure :caption: Model structure :linenos: property1 ... ... ... ... For example one code instruction might generate the java POJO’s (back-end) while the second code instruction would generate the front-end in order to visualize and manipulate the data in the back-end. All these code instructions use the same model. .. rubric:: Sub elements .. list-table:: **sub elements of ** :widths: 15 70 15 :header-rows: 1 :class: tight-table * - Name - Details - Number * - :ref:`metadata ` - With metadata the code instruction logic can make decisions. The logic can also add metadata itself. - 0..n * - :ref:`package ` - Used to group objects (entities in the data model) - 0..n Child elements -------------- The tree of the model root element can contain the following child elements which will be explained separately: .. toctree:: :maxdepth: 1 ModRef_Package ModRef_Object ModRef_Attribute ModRef_Reference ModRef_Metadata