|
| 1 | += Model API |
| 2 | +:navtitle: `model-api` |
| 3 | + |
| 4 | + |
| 5 | +:tip-caption: 🔗 Quick Links |
| 6 | +[TIP] |
| 7 | +-- |
| 8 | +https://api.modelix.org/2.3.0/model-api/index.html[API doc^] | https://github.com/modelix/modelix.core[Repository^] | https://github.com/modelix/modelix.core/blob/main/model-api/build.gradle.kts[buildfile^] |
| 9 | +-- |
| 10 | + |
| 11 | +:tip-caption: 🔗 Artifacts |
| 12 | +[TIP] |
| 13 | +-- |
| 14 | +`org.modelix.model-api`: https://artifacts.itemis.cloud/service/rest/repository/browse/maven-mps/org/modelix/model-api/[Nexus^] https://github.com/modelix/modelix.core/packages/1834768[GitHub Packages^] |
| 15 | + |
| 16 | +// TODO `org.modelix.model-api-jvm`: |
| 17 | + |
| 18 | +// TODO `org.modelix.model-api-js`: |
| 19 | +-- |
| 20 | + |
| 21 | + |
| 22 | +== Overview |
| 23 | + |
| 24 | +The *Model API* (`model-api`) is a Kotlin component which provides a metamodel independent model API. |
| 25 | +This API is the shared basis and used across all modelix components. |
| 26 | + |
| 27 | + |
| 28 | +The `model-api` provides three distinct parts |
| 29 | + |
| 30 | +1. `org.modelix.model.api`: The untyped API to provide model access |
| 31 | +2. `org.modelix.model.data`: Data classes for (meta-)model serialization |
| 32 | +3. `org.modelix.model.area`: Model grouping and transactional access |
| 33 | + |
| 34 | + |
| 35 | +=== 1. `org.modelix.model.api` |
| 36 | + |
| 37 | +The following diagram provides a meta-model of the `model-api` |
| 38 | + |
| 39 | +image::model-api.api.png[] |
| 40 | + |
| 41 | +An **untyped** access to model content is possible when only using the `model-api`. |
| 42 | +In case you want to use domain-specific model access (i.e. **typed** access), the xref:core:reference/component-model-api-gen.adoc[model-api-gen] provides a generator which generates a typed model API from your existing meta-model. |
| 43 | +This generated API specializes the `model-api`. |
| 44 | + |
| 45 | + |
| 46 | +=== 2.`org.modelix.model.data` |
| 47 | + |
| 48 | +Additionally, the `model-api` provides serializable data classes to represent a meta-model. |
| 49 | +The following diagrams show a class diagram of the data classes for the model and meta-model. |
| 50 | + |
| 51 | +[cols="a,a", frame=none, grid=none] |
| 52 | +|=== |
| 53 | +| image::model-api.data.model.png[width=69%] |
| 54 | +| image::model-api.data.metamodel.png[] |
| 55 | +|=== |
| 56 | + |
| 57 | + |
| 58 | +//=== 3. `org.modelix.model.area` |
| 59 | +//TODO |
0 commit comments