Code Generation - STARIONGROUP/COMET-SDK-Community-Edition GitHub Wiki
Introduction
The CDP4-COMET Data Model is designed using a Model Driven Engineering (MDE) approach. By expressing design specifications as a standardized model (e.g. diagrams) the architect can reason on an abstract data model solution that fulfils the requirements of a specific domain without focusing on other design details. The abstract design allows other engineering domains to also interpret the models and provide input from their specific view. The MDE approach ensures that the resulting design is software implementation agnostic. This means that it can be the basis for any specific software implementation.
UML
The CDP4-COMET Data Model is derived from [ECSS-E-TM-10-25A-Annex-A]] master UML model. [[ECSS-E-TM-10-25A-Annex-A]] is defined in the form of Unified Modeling Language (UML) version 2 class diagrams, using the MagicDraw tool. From this model a UML Eclipse v3 format has been exported which can be edited using Papyrus. Papyrus is an industrial-grade open source Model-Based Engineering tool. The [CDP4-COMET Data Model has been extended using Papyrus.
Code Generation
The Papyrus tool serializes a model using XMI. The XML Metadata Interchange (XMI) is a widely used XML interchange format. It defines the following aspects involved in describing objects in XML:
- The representation of objects in terms of XML elements and attributes.
- The standard mechanisms to link objects within the same file or across files.
- The validation of XMI documents using XML Schemas.
- Object identity, which allows objects to be referenced from other objects in terms of IDs and UUIDs
The CDP4-COMET Data Model XMI is used as source to generate parts of the COMET-SDK software, including (but not limited to):
- CDP4Common DTO
- CDP4Common POCO
- CDP4Common Meta-Data#metainfo-classes
- CDP4JsonSerializer DTO-Serialization
- CDP4JsonSerializer DTO-Deserialization
The Starion Group maintains an internal C# XMI/UML model parser that is used to create an in memory representation of a UML model that can be queried an iterated. DotLiquid is used to generate C# class files, SQL schema, etc.