Skip to content

Microservice-API-Patterns/MDSL-Specification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservice Domain-Specific Language (MDSL)

What is MDSL?

MDSL supports the API Description pattern from Microservice API Patterns (MAP).

This is the "hello world" of service contracting, specified in MDSL:

API description HelloWorldAPI data type SampleDTO {ID, D} endpoint type HelloWorldEndpoint exposes operation sayHello expecting payload D<string> delivering payload SampleDTO API provider HelloWorldAPIProvider1 offers HelloWorldEndpoint API client HelloWorldAPIClient1 consumes HelloWorldEndpoint 

As the example shows, the MDSL grammar defines two related specification languages:

  1. An API description language: API endpoints types (a.k.a. service contracts types) can be defined, including their operations; API client and providers of instances of these endpoint types can be specified elaborately, including Service Level Agreements (SLAs).
  2. A data contract language providing a type system for DTRs in request and response messages (which is very compact): data type SampleDTO {ID, D}.

These two languages can be used independently of each other; for instance, data contracts for operations in contract types can also be specified in JSON Schema (or XML Schema). Specifications do not have to be complete to be useful (e.g., in early stages of service design); tools will be expected to check that, use defaults, etc.

Getting Started

Change Log

The current version of MDSL is 3.1.0. See release notes for more information.

Repository Structure

This repository contains:

  • dsl-core, the DSL project, Xtext grammar and everything else needed to build an Eclipse plugin providing a MDSL editor.

If you want to contribute to MDSL, you have to clone this repo and generate the required Xtext files.

Note: Setup and build process have been improved recently to ease integration with Context Mapper. As a consequence, the project has to be imported as an existing Maven project, and an adjustment of the IDE setup is required. The readme of the main project contains detailed instructions.

Context Information: MAP and Xtext

All Microservice API Patterns (MAP) are supported and integrated one way or another:

  • As grammar rules
  • As enums for roles and responsibilities
  • As stereotypes annotating representation elements

See "MAP Decorators" section of the MDSL tutorial for more information.

The MDSL grammar was originally developed with Eclipse Photon (4.8.0) and Xtext (2.14) as provided by the Eclipse Modeling Platform. MDSL makes use of the referencing feature in Xtext ('name' attribute). Future work is required to also support this technology in other IDEs (such as Visual Studio Code).

Acknowledgements

The creation and open source release of MDSL 3.0 was supported by the Hasler Foundation.

Contributors (input, DevOps support, feedback):

  • Olaf Zimmermann (ZIO)
  • MAP co-authors: Mirko Stocker, Daniel Lübke, Cesare Pautasso, Uwe Zdun
  • Stefan Kapferer (author of MDSL generator in Context Mapper)
  • Bachelor students at HSR FHO
  • MS 2019 and VSS 2019 participants

Getting Involved

We are open to welcome new contributors who want to help improve MDSL language specification and tools:

  • Feel free to create issues in GitHub.
  • Submit pull requests. If you do so, we assume that you comply with this Developer Certificate of Origin.
  • Contact us to discuss collaboration and integration opportunities.

Copyright: Olaf Zimmermann, 2019-2020. All rights reserved. See license information.