Skip to content

Commit cd008a4

Browse files
authored
Merge pull request #106 from modelix/docs/add-model-api
MODELIX-2: Add initial model-api documentation
2 parents b45c1c1 + 0078709 commit cd008a4

File tree

7 files changed

+61
-2
lines changed

7 files changed

+61
-2
lines changed
165 KB
Loading
165 KB
Loading
97.5 KB
Loading

docs/global/modules/core/pages/reference/component-metamodel-export.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ https://github.com/modelix/modelix.core[Repository^] | https://github.com/modeli
1111

1212
In order to export a meta-model (i.e. the structure aspect of a langauge) from MPS, modelix uses the MPS solution `metamodel-export`.
1313
This solution maps the structure of a language to corresponding serializable data classes of the https://api.modelix.org/2.3.0/model-api/org.modelix.model.data/index.html[`model-api`] (e.g. `LanguageData` and `ConcepData`).
14-
Further, the `metamodel-expor` provides a command line interface to export these data classes to a JSON file from outside of MPS.
14+
Further, the `metamodel-export` provides a command line interface to export these data classes to a JSON file from outside of MPS.
1515

1616

1717

docs/global/modules/core/pages/reference/component-model-api-gen-gradle.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
= Gradle Plugin for the Model API Generator
22
:navtitle: `model-api-gen-gradle`
33

4-
54
:tip-caption: 🔗 Quick Links
65
[TIP]
76
--
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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

docs/global/modules/core/partials/nav-reference.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* xref:core:reference/component-model-api.adoc[]
12
* xref:core:reference/component-model-server.adoc[]
23
* xref:core:reference/component-metamodel-export.adoc[]
34
* xref:core:reference/component-model-api-gen.adoc[]

0 commit comments

Comments
 (0)