How it works
Definitions
First, let's give a definition to some of the terms that will be used in this chapter:
Term | Definition |
---|---|
Expansion | Expansion is the process of generating code based on a Model. |
Model | An abstract description of an Application. The developer describes their desired Application in a collection of Model Files. |
Artifact | In the context of Expansion, an Artifact always refers to a file generated by Expanders. |
Expander | An Expander is a combination of mapping logic and a template that, when given an Element, generates a single Artifact. |
Element | An Element is a small part of the Model. Artifacts are generated by iterating over each Element in the Model and applying all applicable Expanders. |
Feature | In the context of Expansion, a Feature is something that requires a condition to activate, and adds code to several Expanders to implement cross-cutting logic. |
Composite | After the model is read, it is transformed and linked to form Composites. These |
From Model to Expanding Artifacts
The process of expanding from a model can be described into 4 steps.
- The first 3 steps are implemented with the ModelLoader. This class is provided by
prime-core
. - The last step are implemented by the ExpansionRunners. These classes are provided by
expanders-core
.