Mapped Data Types' Standards as 1st-Class Citizens. #206
Replies: 6 comments 2 replies
-
I would like to emphasize the distinction between "standard" and "encoding", as Orchestra currently including "JSON" and "XML" as standards could cause confusion. I see a "standard" as an agreed-upon way to structure Orchestra-specified messages/data using a particular encoding, whereas there could be many disparate standards that use the same encoding. For example, two different standards that use JSON encoding might encode the same data as: {
"MyTimestampField": "2024-06-07T11:59:31+00:00"
} or {
"MyTsFld": 1717761571
} The FIX JSON Standard is such a standard, and is what I assume is meant in Orchestra when it refers to the As far as the ability to define standards in Orchestra itself, my position is that there should be a clear way to define and "configure" a standard, but not necessarily actually include all that many attributes. That is, the "configuration" here could probably simply be an XML extension, where a particular application/implementation can be given hints. One route here would be:
For example: <fixr:repository>
<fixr:standards>
<fixr:standard name="MyStandard">
<fixr:extension>
<internal:endianness xmlns:internal="https://..." endianness="BIG_ENDIAN"/>
</fixr:extension>
<fixr:annotation>
<fixr:documentation purpose="SYNOPSIS" contentType="text/markdown">This is my standard</fixr:documentation>
</fixr:annotation>
</fixr:standard>
</fixr:standards>
<fixr:datatypes>
<fixr:datatype name="MyTimestamp">
<fixr:mappedDatatype standard="MyStandard" base="string">
<fixr:extension>
<internal:timestamp xmlns:internal="https://..." format="yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"/>
</fixr:extension>
</fixr:mappedDatatype>
<fixr:annotation>
<fixr:documentation purpose="SYNOPSIS" contentType="text/markdown">Some datatype I care about</fixr:documentation>
</fixr:annotation>
</fixr:datatype>
</fixr:datatypes>
</fixr:repository> |
Beta Was this translation helpful? Give feedback.
-
@patricklucas any reason to use just I am not sure about your comment on JSON above. I believe that the actual JSON standard is meant here. The FIX standard for it is called "Encoding FIX using JSON" and is about the choice of attribute names not about a different JSON syntax. That should be standard JSON. |
Beta Was this translation helpful? Give feedback.
-
Thinking about a real-world example, I noticed that the NASDAQ OUCH specification models optional fields and codeset values at the logical level. This is a case where the details of the binary encoding are leaking into the Orchestra layer. For example, the field BBOWeightIndicator defines a code value called "space" which means "unspecified" i.e. the field is optional.
Above would mean we no longer need to model the "unspecified" name/value in the codeset definition. Codeset BBOWeightIndicatorCodeSet type Alpha (3)Synopsis
This might cross over to the other discussion on supporting binary formats, but wanted to show how the proposal might solve this problem. |
Beta Was this translation helpful? Give feedback.
-
@francescoloconte, to answer your original question, the XML schema already allows other values than the ones listed in
The actual value of datatype standard is a union of the explicit enumeration and xs:string. In short, while the enumeration suggests standard values, you can actually enter any string. |
Beta Was this translation helpful? Give feedback.
-
Discussion here seems to be about whether the type system is strictly at the encoding layer or possibly another layer. Also, some encodings such as JSON and XML are supported by schemas. I believe details about protocol layers are better addressed by the Orchestra Interfaces schema--that was its intention--rather than the Repository schema. |
Beta Was this translation helpful? Give feedback.
-
A suggestion about how to specify a standard using an existing enumeration: See IANA Media Types. Many common protocols such as XML and JSON are listed. We have already registered |
Beta Was this translation helpful? Give feedback.
-
I understand from the Orchestra specifications that DataTypes are used to define the “Value Space”, while MappedDataTypes are used to define the “Lexical Space”. You can find it at this link. My understanding is that the Lexical Space indicates how data is encoded (i.e., represented) when serialized. This is also confirmed by this ChatGPT response.
Assuming that we agreed on the above, currently the Orchestra schema defines the following “Standards” for MappedDataTypes: GPB, ISO11404, JSON, SBE, TAG_VALUE, XML. To me, this indicates that one is able to specify the encoding of DataTypes when using one of these standards. For example, when encoding an Orchestra model to FIXML, one would use the encoding instructions provided by the “XML” MappedDataTypes.
If we are still in agreement so far, my question is: If I am using Orchestra to describe a binary protocol (e.g., LSEG Millenium IT), and I want to include its specific encoding information using MappedDataTypes, which Standard should I use?
In my opinion, I should be able to create a new Standard, for example “MIT” (or whatever name I wish to use), and use this new value in my MappedDataTypes instructions. If I wanted to support yet another encoding for my protocol, e.g. ASN.1, I would create another value for the Standard, perhaps called “ASN1”, and use it in another set of MappedDataTypes instructions. Ultimately, the MappedDataTypes instructions are to be interpreted in the context of the external standard, such as SBE, GPB, etc.
If you agree with my statement above, then it leads that “Standards” should be first-class citizens in Orchestra, and one should be able to create new ones? And if that were the case, I think each standard should also have an attribute called “Endianness”, to specify whether such standard uses Big-endian or Little-endian.
Beta Was this translation helpful? Give feedback.
All reactions