-
Notifications
You must be signed in to change notification settings - Fork 3
CDP4JsonSerializer Overview
COMET is the new name for what was previously called the CDP4. We are transitioning the applications and software libraries. The code and documentation will still refer to CDP4 in a number of places while we are updating.
The CDP4JsonSerializer library is used to serialize and deserialize the classess that are defined in the COMET Data Model. It makes use of the popular high-performance JSON framework for .NET Json.NET to process JSON. The CDP4JsonSerializer library exposes ICdp4JsonSerializer
interface and Cdp4JsonSerializer
class that can be used to serialize or deserialize any object. It the objects are DTO objects or a Classless-DTO the CDP4JsonSerializer makes used of optimized serialization and deserialization code that does not rely on reflection but on hard coded mappings between the properties of the classes and properties of JSON objects.
The CDP4JsonSerializer is used by the COMET-IME and the COMET® Web Services.
The COMET Data Model is an extension of ECSS-E-TM-10-25A-Annex-A where COMET® specific Classes and properties have been added. The COMET® extensions, both classes and extra properties on existing classes, have been modelled in the UML master model and have been decorated with a CDPVersion
stereotype.
The CDP4JsonSerializer makes it possible to include or excluded COMET® specific properties when serializing or deserializing DTO objects. This is achieved by initializing the CDP4JsonSerializer with the IMetaDataProvider and a Version
parameter. The classes and properties that are smaller than or equal to the specified Version
will be included in the (de)serialization process, the others are excluded.
The following code snippet instantiates the Cdp4JsonSerializer with version 1.0.0
which is plain ECSS-E-TM-10-25A-Annex-A. The serialize method will not incldue any COMET® specific data-types or properties that have been added to the meta-model.
var metaDataProvider = new MetaDataProvider();
var serializer = new Cdp4JsonSerializer(metaDataProvider, new Version(1, 0, 0));
copyright @ Starion Group S.A.