Skip to main content

Expanders

ExpanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. is a term used to define the core concept in the code generation framework of Normalized SystemsSystemA set of interconnected components that work together to achieve a specific purpose or function.. Its primary role is to generate source code, based upon a template and a model.

To generate this code, an expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. combines three main inputs:

  • Model: Attributes of elements of your model (e.g. name of a data elementData Element (DataElement). A fundamental data concept or entity within an application's domain, acting as an anthropomorphic translation of a real-life object or concept., type of a fieldFieldA property of a DataElement expanded to a database column and user interface input element.)
  • Mapping template: Template file to read the model info and translate it to variables for the code template
  • Code template: The file containing the source code, enriched with mapping variables to dynamically insert values
Example expander files

A model file describing a data elementData Element (DataElement). A fundamental data concept or entity within an application's domain, acting as an anthropomorphic translation of a real-life object or concept. Car with two fieldsFieldA property of a DataElement expanded to a database column and user interface input element..

<dataElement>
<name>Car</name>
<fields>
<field>
<name>name</name>
<fieldType>VALUE_FIELD</fieldType>
<valueField>
<type>String</type>
</valueField>
</field>
<field>
<name>seats</name>
<fieldType>VALUE_FIELD</fieldType>
<valueField>
<type>Integer</type>
</valueField>
</field>
</fields>
</dataElement>

Expanders in the bigger picture​

ExpandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. are not used on their own. They are packaged in expansion resourcesExpansion Resource (ExpansionResource). A reusable resource bundle containing expanders and features that provide specific application capabilities, defined in the expansion settings and added to the classpath during expansion., which a project selects in its expansionSettings.xml. During expansion, the model is loaded, and every applicable expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. is run for every element of the model.

Because the expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. are separate from the model, both can evolve independently. When an expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. improves, every applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. using it gets the improvement by expanding again. This is called rejuvenationRejuvenationThe core process of harvesting custom code from designated anchors and ext directories, updating model configurations, and re-expanding code artifacts to continuously evolve software without losing custom implementations..

The same mechanism is used to generate more than NS applicationsNS Application (NSApplication). A pre-built software stack that provides common enterprise application functionality such as CRUD, search, authentication, and business process modeling out of the box.. The project setup of a repository, an Angular frontend, or your own metamodel are all expanded by expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..


Documentation Overview​

Next in this section, the core concepts of expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. and the concept of expansion are explored.

Guides on how to get started with creating an expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. can be found in the Developer Hub. A technical deep-dive into the process of expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. making can be found in the reference guides: