Core Concepts
Expansion Resources
An expansion-resource or expansion-resource bundle is a jar which can contain:
- ExpandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact., which will generate new artifactsArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project.;
- Features, which can insert content into artifactsArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project. from expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. of this expansion resourceExpansion 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. or expansion resources the project depends on;
- Additional expansion steps, which can perform tasks before, during or after expansion;
- Data resources, which contain metadata like technologies, layerImplementations etc.;
- Model resources, which provide components for expansion.
Expanders
An expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. generates a single artifactArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project. for an element of the model. Each expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. is linked to an element type (such as DataElement or Component), a layerLayerLogical separation of functionality within a single system/application, focused on code organization. type and a technology. Together, these decide where the artifactArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project. is located and whether it is expanded at all: a DATA_LAYER expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. is skipped when that layerLayerLogical separation of functionality within a single system/application, focused on code organization. is disabled, and an expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. for a technology only runs when that technology is selected. An isApplicable condition can narrow this down further, for example to expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. that only run when a certain option is set.
Cross Cutting Concerns
There are various possible cross-cutting concerns that need to be injected into an applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. at multiple places. Features are additions to the expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. which aim to add pieces of code to multiple expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact.. A feature can then be enabled with some option or another condition to add logic to multiple artifactsArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project. at once. That way, crosscutting concerns can be extracted from the expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. to provide further decoupling.
A feature inserts its code at feature anchorsAnchorA marker within generated source code reserved for adding custom logic during re-expansion.: named points in the template of an expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact.. An expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. that defines feature anchorsAnchorA marker within generated source code reserved for adding custom logic during re-expansion. can be extended by features from other 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., without changing the expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. itself. A feature anchorAnchorA marker within generated source code reserved for adding custom logic during re-expansion. can also hold default content, which is used when no feature adds anything to it.
Customization
Next to feature anchorsAnchorA marker within generated source code reserved for adding custom logic during re-expansion., templates also contain custom anchorsAnchorA marker within generated source code reserved for adding custom logic during re-expansion.. These are points where developers of the expanded applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. can add custom code, so that this code is reinserted after re-expanding. Custom code is harvested from the expanded artifactsArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project. before a new expansion, and put back in place afterwards.
| Feature anchorAnchorA marker within generated source code reserved for adding custom logic during re-expansion. | Custom anchorAnchorA marker within generated source code reserved for adding custom logic during re-expansion. | |
|---|---|---|
| Filled by | Features 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. | Developers of the expanded applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. |
| Purpose | Crosscutting concerns, extensions of an expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. | Project-specific code |
| Survives re-expansion | Regenerated by the feature | Harvested and reinserted |
Additional expansion steps
AdditionalExpansionSteps are a way to add logic before or after expanding. They are not tied to a single artifactArtifactA build or deployment result, such as a Docker container image or Java archive, produced by a software project.,
and are run in a specific phase of the expansion. Well-known examples are the steps that copy the ext
directories of each component to the expansion folder, and that harvest the customizations in them.
Data resources
DataResources are data files in expansion-resources. When a developer adds an expansion-resource to their expansionSettings, the data from the DataResources will be available to the model. Uses can vary from parts of the model, like ValueTypes, to technical data for the expansion:
- Technologies describe a library or framework used in the expanded project to implement a concern, such as a database or a search engine.
- LayerImplementations combine a technology and a layerLayerLogical separation of functionality within a single system/application, focused on code organization. type, and add the source directories and runtime dependencies for that technology.
- Option types define the options that can be set on the model to activate certain features and expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..
- NativeTypes represent how a ValueType is mapped to its native representation in the different technologies, such as a Java class or a database column type.
Model resources
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. can also include components which can be added to your applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. if the expansion resourceExpansion 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. is present. This is a useful way to make reusable components which can be shared and versioned. The Base Components are delivered this way.
Tags
ExpandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact., features and expansion steps can carry tags. These tags are designed to simplify conditions, group related ExpandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. and Features and allow for better traceability: an expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. with a tag is only included when the target element has that tag as well. Tags can be added to elements through options, or activate related features together.
Stacks and beams
Expansion-resources can include dependencies on other expansion-resources. These dependencies are fetched
automatically when the expansion-resource is used. This mechanism is used to create bundles of expansion-resources,
called stacks: an expansion-resource that only defines a set of dependencies on other expansion-resources. The
nsx-default-stack and the beams, such as service-api-beam and angular-beam, are stacks.