Message Formats and Common Information Model



Following my post last summer detailing how Chorus.js would solve the problem of expressing message formats in relation to a “Common Information Model”, I am happy to report that I have completed the development of a DSL, which I believe is a major advance in the way we manage API, Resource and Service contracts (Yes Cord includes an equivalence between Resource-Orientation and Operation-Orientation, how could they not be equivalent?).

This DSL solves a key problem of schema technologies (XSD, JSON-Schema,…) which cannot properly manage the relationship between a data model and message formats. These technologies are capable of either defining the structure of a data model, or the validation rules of message formats, but they are not capable of managing both at the same time. The flaw in these schema languages stems from the import mechanism which forces any change to the data model to become visible to message format definitions without any possible isolation. For more details, please read my earlier post.

The solution I developed, not only decouples the evolution of the data model from the message formats, but the DSL explicitely manages the versions of both the entities of the data model and the message formats, which is unheard of in most software technologies (Object Orientation, Functional Programming, …).

I always found it quite ironic for an industry which is proud to enable “change” that none of its technologies, languages and frameworks can deal with versioning (i.e. change) explicitely, let alone effectively. Versioning code, schemas, config files… ends up as a nightmare of epic proportion. This is particularly true of message formats.

The CIM DSL is part of the “Cord” language, developed as part of the Chorus.js project. The DSL was developed using Eclipse Xtext. Currently the plugin generates OpenAPI 2.0, XSDs, WSDLs and PlantUML class diagrams.

There are only four steps you need to do to use this tools:

  1. Download Eclipse Xtext here
  2. Install the Chorus.js plugin into Eclipse
  3. Create a new project
  4. Add a new file to the project (with a .cord extension) and copy the code below (please copy/paste the code below in the .cord file, the OpenAPI, WSDL/XSD generations happens automatically when you save the file):

Here is the PlantUML diagram which is generated from the CIM definition:


Here is the full documentation of the DSL:

Leave a Reply

Your email address will not be published. Required fields are marked *

32 + = 35