Skip to content

Commit 4cc7343

Browse files
author
socadk
committed
MDSL Language and Tools Version 5.2.2
1 parent 62000c8 commit 4cc7343

File tree

130 files changed

+2684
-571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+2684
-571
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Microservice Domain-Specific Language (MDSL) 5.1
1+
Microservice Domain-Specific Language (MDSL) 5.2
22
================================================
33

44
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
@@ -76,7 +76,7 @@ If you want to contribute to MDSL, you have to clone this repo and generate the
7676

7777
## Change Log
7878

79-
The current version of the MDSL language is 5.1; the tool version is 5.1.2. This MDSL version extends service contracts with support for events, states, flows, compensation (as experimental technology previews). It also supports true REST level 3 concepts both on the abstract endpoint type level and in the redesigned bindings and comes with additional Fremarker generators (Markdown reports, ALPS).
79+
The current version of the MDSL language is 5.2; the tool version is 5.2.0. This MDSL version extends service contracts with support for events, states, flows, compensation (as experimental technology previews). It also supports true REST level 3 concepts both on the abstract endpoint type level and in the redesigned bindings and comes with additional Fremarker generators (Markdown reports, ALPS).
8080

8181
See [change log](changelog.md) for an evolution history; see GitHub [release notes](https://github.com/Microservice-API-Patterns/MDSL-Specification/releases) for additional update information.
8282

changelog.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
Also see GitHub [release notes](https://github.com/Microservice-API-Patterns/MDSL-Specification/releases).
44

5+
V5.2, June 2021
6+
7+
* Grammar now support events better, API description has an overview property (for AsyncMDSL)
8+
* Technology previews (no tools yet): scenarios/stories; flows and events; state, compensation
9+
* ALPS Generator as separate menu entry (MDSL menu in plugin redesigned)
10+
* MVP: three quickfixes for data type completion
11+
* MVP of core MDSL to AsyncMDSL transformation
12+
* Initial draft of Xtend formatter (AP types, channels)
13+
* Genmodel extensions for flows
14+
515
V5.1, March to May 2021
616

717
* Freemarker template for ALPS and API Description (Markdown)

docs/async-mdsl.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,6 @@ Valid AsyncMDSL specifications can be mapped to [AsyncAPI](https://www.asyncapi.
237237
* [Quick reference](./quickreference), [tutorial](./tutorial) and [tools](./tools)
238238
* Back to [MDSL homepage](./index).
239239

240-
*See [license information](https://github.com/socadk/MDSL/blob/master/LICENSE).*
240+
*See [license information](https://github.com/Microservice-API-Patterns/MDSL-Specification/blob/master/LICENSE).*
241241

242242
<!-- *EOF* -->

docs/datacontract.md

+19-101
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,49 @@ Data Contracts and Schemas in MDSL
1111

1212
## Use Cases for MDSL Data Type Models
1313

14-
MDSL aims at supporting agile modeling. Any service API exposes a published language of some kind This language contains data elements in several places:
14+
MDSL aims at supporting agile modeling. Any service API exposes a published language of some kind. Such published language contains data elements in several places:
1515

16-
* Payload and headers of operations specified in an MDSL service [endpoint contract](./servicecontract)
17-
* Service Level Objectives (SLOs) and/or Service Level Indicators (SLIs) that are part of [Service Level Agreements (SLAs)](https://microservice-api-patterns.org/patterns/quality/qualityManagementAndGovernance/ServiceLevelAgreement)
18-
* Data Transfer Objects (DTOs) or, more precisely, Data Transfer Representations (DTRs)
16+
* Payload and headers of operations, specified in an MDSL service [endpoint contract](./servicecontract).
17+
* Service Level Objectives (SLOs) and/or Service Level Indicators (SLIs), being part of [Service Level Agreements (SLAs)](https://microservice-api-patterns.org/patterns/quality/quali.tyManagementAndGovernance/ServiceLevelAgreement)
18+
* Data Transfer Objects (DTOs) or, since we are not inside an object-oriented program here, *Data Transfer Representations (DTRs)*.
1919

20-
<!-- TODO feature link types, event types -->
20+
*Note:* Versions 5.1 the MDSL grammar introduced link types and event types. These features are still under design and development; the MDSL tools do not support them yet. A first sample specification featuring event types can be found [here](https://github.com/Microservice-API-Patterns/MDSL-Specification/tree/master/examples/examples-advanced/AdvancedServiceContractConcepts.mdsl); please view it as a technology preview. Link types are featured in the [HTTP and REST binding](./rest-binding).
2121

2222
## Concepts
2323

24-
The structure patterns from MAP form the base of the type system that is used in MDSL. *Identifier-Role-Type (IRT)* triples `"aName":D<String>` for [Atomic Parameters](https://microservice-api-patterns.org/patterns/structure/representationElements/AtomicParameter) (only the role is mandatory):
24+
The structure patterns from MAP form the base of the type system that is used in MDSL.
25+
26+
*Identifier-Role-Type (IRT)* triples `"aName":D<String>` specify [Atomic Parameters](https://microservice-api-patterns.org/patterns/structure/representationElements/AtomicParameter) (only the role is mandatory):
2527

2628
* The optional *identifier* `"aName"` corresponds to the variable names in programming languages and data representation languages such as JSON.
2729
* The *role* can be any [element stereotype](https://microservice-api-patterns.org/patterns/structure/) from MAP: `D` (data), `MD` (metadata), `ID` (identifier), `L` (link).
2830
* The optional *type* `<String>` is either basic (see below) or nested/structured; it also corresponds to a concept known from type systems in programming and data representation languages.
2931

30-
Simple, yet powerful nesting is supported (as known from data representation languages such as JSON):
32+
Simple, yet powerful nesting is supported, realizes the Microservice API Pattern (MAP) [Parameter Tree](https://microservice-api-patterns.org/patterns/structure/representationElements/ParameterTree):
3133

3234
* The nesting is expressed in an object- or block-like syntax: `{...{...}}`.
33-
* This nesting realizes the Microservice API Pattern (MAP) [Parameter Tree](https://microservice-api-patterns.org/patterns/structure/representationElements/ParameterTree).
35+
* This nesting syntax is similar to that in data representation languages such as JSON (and the Jolie type system).
3436

35-
Already existing metamodels and schema languages can be used alternatively to `MAP_TYPES`. Examples are: `JSON_SCHEMA`, `XML_SCHEMA`, and `PROTOCOL_BUFFER`.
37+
Already existing metamodels and schema languages can be used alternatively to `MAP_TYPES`. Examples are: `JSON_SCHEMA`, `XML_SCHEMA`, and `PROTOCOL_BUFFER`. <!-- BUFFER or BUFFERS? -->
3638

3739
<!-- TODO (L) grammar also has `AVRO_SCHEMA` | `THRIFT_TYPE` | 'GRAPHQL_SDL' | 'OTHER' -->
3840

39-
MDSL specifications do not have to be complete to be useful (e.g., in early stages of service design); tools are expected to check completeness, use defaults for missing parts, etc.
41+
*Note:* MDSL specifications do not have to be complete to be useful (e.g., in early stages of service design); tools are expected to check completeness, use defaults for missing parts, etc.
4042

4143
### The I in IRT: Identifiers
4244

43-
Identifiers must be embedded in double quotes. They may contain blanks or underscores.
45+
Identifiers must be embedded in double quotes`"somePayloadData"`. They may contain blanks or underscores.
4446

4547
### The R in IRT: Role stereotypes for representation elements/data types
46-
The role within a message payload that is played/taken by a particular part of a header or payload (a representation element in MAP terminology) is the primary specification element; identifiers and data type are optional. This three-part specification (with only one mandatory part) is quite different from the identifier-type pairs typically used in programming languages. It makes it possible to create rather compact (but still incomplete) specifications during agile API modeling. <!-- talk about rationale for this modeling decision even more? -->
48+
The role within a message payload that is taken by a particular part of a header or payload (a representation element in MAP terminology) is the primary specification element; identifiers and data type are optional. This three-part specification (with only one mandatory part) is a bit different from the identifier-type pairs typically used in programming languages. It makes it possible to create rather compact (but still incomplete) specifications during agile API modeling. <!-- talk about rationale for this modeling decision even more? -->
4749

4850
An abstract, unspecified element is represented as `P` (for parameter or payload placeholder). `P` takes the place of the Role-Type elements in the IRT triple introduced above.
4951

5052
Concrete atomic type refinements of `P`, matching the [element stereotypes](https://microservice-api-patterns.org/patterns/structure/) in MAP, are:
5153

5254
* `Data` or `D`, representing a plain/basic data/value role. `D` corresponds to [Data Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/DataElement) in MAP.
53-
* `Identifier` or `ID` for identifiers, MAP: [Id Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/IdElement).
54-
* `Link` or `L` for link identifiers (which are network-accessible, e.g. URI, or URN), MAP: [Link Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/LinkElement).
55+
* `Identifier` or `ID` for identifiers, corresponding to the MAP [Id Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/IdElement).
56+
* `Link` or `L` for link identifiers (which are network-accessible, e.g. URI, or URN), in MAP: [Link Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/LinkElement).
5557
* `Metadata` or `MD` representing metadata, MAP: [Metadata Element](https://microservice-api-patterns.org/patterns/structure/elementStereotypes/MetadataElement).
5658

5759
`D<void>` may represent a generic, unspecified parameter (just like `P`).
@@ -77,13 +79,13 @@ Parameter trees and atomic parameter lists can be used to express optionality if
7779
### Reuse of data type definitions (in multiple representation elements)
7880

7981
~~~
80-
dataContract:
82+
DataContract:
8183
'data' 'type' name=ID
8284
('version' svi=semanticVersioningIdentifier)?
8385
structure=elementStructure;
8486
default=defaultValue?
8587
86-
elementStructure:
88+
ElementStructure:
8789
pf=parameterForest | pt=parameterTree
8890
| apl=atomicParameterList | np=singleParameterNode;
8991
@@ -159,91 +161,7 @@ Note that a parameter tree that only contains atomic parameters `{D<int>, D<stri
159161

160162
## Technology Mappings
161163

162-
### JSON/JSON Schema
163-
164-
| JSON | MDSL | Comments |
165-
|------|------|----------|
166-
| Basic JSON data types | Atomic Parameter | Base types do not match 100% |
167-
| Object (flat) | Parameter Tree (flat) or Atomic Parameter List | Parameter Tree preferred |
168-
| Object (structured) | Parameter Tree (nested) | Straightforward |
169-
| Array | Cardinality of `*` or `+` | Is homogeneous in MDSL/MAP |
170-
171-
### XML Schema
172-
173-
| XML Schema | MDSL/MAP | Comments |
174-
|-----|-----|----------|
175-
| Built-in data types | Atomic Parameter | Not the same expressiveness |
176-
| Sequence element (referencing built-in types) | Parameter Tree (flat) or Atomic Parameter List | Parameter Tree preferred |
177-
| Complex type | Parameter Tree | MDSL syntax more compact |
178-
| Sequence with `maxoccurs` > 1 | Cardinality of `*` or `+` | n/a |
179-
180-
### gRPC and Protocol Buffers
181-
The MAP base types can be mapped in a straightforward manner. `AnyType` is used as default.
182-
183-
<!--
184-
The base types in MDSL map to gRPC and Protocol Buffers like this:
185-
186-
| Protocol Buffers | MDSL |
187-
|-------|------|
188-
| int32 | int |
189-
| int64 | long |
190-
| double | double |
191-
| bool | bool |
192-
| bytes | raw |
193-
194-
TODO tbc (complete mapping?)
195-
-->
196-
197-
Parameter forests and parameter trees translate into nested *messages*.
198-
199-
<!-- An example can be downloaded [here](./Test0APIGrpcPb.proto). -->
200-
201-
<!--
202-
### GraphQL
203-
204-
To be continued (tbc).
205-
-->
206-
207-
<!--
208-
~~~
209-
type Query {
210-
ping(in_dtr: String): String
211-
212-
sayhelloAgain(in_dtr: sayhelloAgainRequestType): sayhelloAgainResponseType
213-
}
214-
215-
type Mutation {
216-
217-
sayhello(in_dtr: sayhelloRequestType): sayhelloResponseType
218-
219-
}
220-
221-
input sayhelloRequestType {aString: String!}
222-
type sayhelloResponseType {identifier1: String!}
223-
224-
input sayhelloAgainRequestType {anInt: Int!}
225-
type sayhelloAgainResponseType {stringList: [String]}
226-
~~~
227-
-->
228-
229-
<!--
230-
### Avro
231-
232-
| Avro | MAP | Comments |
233-
|-----|-----|----------|
234-
| Basic data types | Atomic Parameter | n/a |
235-
| tbc | Atomic Parameter List | n/a |
236-
| tbc | Parameter Tree | n/a |
237-
| tbc | Cardinality of `*` or `+` | n/a |
238-
-->
239-
240-
241-
### Jolie
242-
The MAP base types map to [simple data in Jolie](https://jolielang.gitbook.io/docs/basics/handling_simple_data) in a straightforward manner.
243-
244-
The same holds for the mapping of parameter trees to [Jolie data structures](https://jolielang.gitbook.io/docs/basics/data_structures).
245-
246-
An example can be downloaded [here](./HelloWorldAPIJolieInterfaceAndPort.ol).
164+
See [this page](technology-mappings) for information on how MDSL data types map to their counterparts in technologies such as OpenAPI and REST, WSDL/SOAP, and gRPC.
247165

248166

249167
## Known Limitations

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Quick links:
1616
* [Endpoint Type](./servicecontract), [Data Types](./datacontract), [Provider and Client](./optionalparts), [Bindings](./bindings), [Tutorial](./tutorial), [Quick Reference](./quickreference)<!-- providing skeletons-->
1717
* Technology preview: [AsyncMDSL](./async-mdsl)
1818
* Tools: [Overview](./tools), [CLI](https://github.com/Microservice-API-Patterns/MDSL-Specification/tree/master/dsl-core/io.mdsl.cli), [update site for editor (Eclipse plugin)](./updates/)
19-
* Generators: [OpenAPI generator](./generators/open-api), [Protocol buffers generator](./generators/protocol-buffers), [Graphql generator](./generators/graphql), [Jolie generator](./generators/jolie), [Java «Modulith» generator](./generators/java), [Arbitrary textual generation with Freemarker](./generators/freemarker)
19+
* Generators: [OpenAPI generator](./generators/open-api), [Protocol buffers generator](./generators/protocol-buffers), [Graphql generator](./generators/graphql), [Jolie generator](./generators/jolie), [Java "Modulith" generator](./generators/java), [Arbitrary textual generation with Freemarker](./generators/freemarker)
2020
* Language and tools repository (GitHub): [XText grammar](https://github.com/Microservice-API-Patterns/MDSL-Specification/blob/master/dsl-core/io.mdsl/src/io/mdsl/APIDescription.xtext), [examples](https://github.com/Microservice-API-Patterns/MDSL-Specification/tree/master/examples) folder
2121

2222
<!--

0 commit comments

Comments
 (0)