Skip to main content

Programs and Modules

An NS Model is structured into Programs and Modules.

  • Programs are the root of a Model. E.g. Application.
  • Modules are reusable parts of the Model. E.g. Component. A Module can be shared among multiple Programs.

ProgramTypes​

Programs have ProgramTypes. These types are defined in expansion-resources as data-resource and can be referenced by individual models.

The ProgramType provides information for the ModelLoading and Expanders:

  • The rootExpandableElement, referring to the type of Element that will act as Program Element. E.g. elements::Application.
  • A programFactory, providing implementations to load the model.
  • model, source and expansion directories.
  • A set of ConcernTypes, which represent what technologies are required to be defined.
  • A set of LayerTypes, defining the layers that can be expanded at the level of the Program.

ModuleTypes​

Modules have ModuleTypes. Similar to the ProgramTypes, they provide information surrounding the Modules:

  • The expandableElement, referring to the elementType for the Module.
  • A moduleFactory, also providing implementations for loading the Modules
  • model, source and expansion directories.
  • A set of ConcernTypes.
  • A set of LayerTypes, defining the layers that can be expanded at the level of the Module.

ProgramComposite and ModuleComposite​

Once loaded, the ProgramComposite and ModuleComposites represent the entirety of the model. They link to the elements they represent with the fields programElement and moduleElement, respectively.

They each have a set of technologies. These technologies are set during the enrichment phase of the model loading. These sets of technologies, together with the LayerTypes on the ProgramType/ModuleType, define which Expanders will be applied.