ElementClasses
Within an ontology, ElementClasses are the primary construct used to define the entities of your domain. These concepts will make up your metamodel.
An ElementClass is defined using attributes and how it relates to other classes:
- Attributes: properties with simple data types (defined inside the ontology).
- References: references describe the relation between ElementClasses. There are different types of references, which all define a different type of relation.
On ElementRoles
Every ElementClass has a role, which determines how it behaves in the model: where it lives, whether it needs a parent, and whether it can be expanded into code. Most domain concepts use the element role; other roles exist for reusable data (data), model roots (program, module), and a few specialized cases (config, taxonomy, variants, exports).
Since Program, and Module hit the core architecture of your metamodel, and thus entail various consequences. these
roles have their own documentation pages.
On Polymorphism
An ElementClass can define a superclass, allowing instances of a subclass to also be treated as the superclass. This enables polymorphism: references can target the abstract superclass while subclasses provide different implementations, and expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. can target the superclass to generate behavior shared across all subclasses.
On Identity
Attributes can be marked as identifiers. These are combined into a unique key, used to reference an element elsewhere in the model or to look it up in tests and logic.