Closed zamhassam closed 5 years ago
Summary of discussion of May 8 in HPWG conference call:
Let's assume that the boundaries of a component block such as Instrument are respected. Then, a component is the same thing as a repeating group, except that the numInGroup is always 1, or perhaps zero if the component is optional. Like a repeating group, it would support extension and could include nested groups and var length fields. To support extension, you must send blockLength on the wire, so we might as well keep the dimension header the same format as for a repeating group, except that the numInGroup element is constrained by maxValue
, an attribute that already exists.
<composite name="componentSizeEncoding">
<type name="blockLength" primitiveType="uint16"/>
<type name="numInGroup" primitiveType="uint16" maxValue="1"/>
<type name="numGroups" primitiveType="uint16"/>
<type name="numVarDataFields" primitiveType="uint16"/>
</composite>
This could be difficult to implement efficiently. An alternative which would be to allow a repeating group to contain another message. Allowing a message to contain a repeating group of messages is more like other type systems and composable. I'd be tempted to not add this to the specification without prototyping to get a better understanding of the consequences.
After a discussion with @zamhassam we agree with Martin's assessment and are happy for this issue to be closed until we are able to get an indication of its implementation viability, if we are able to prototype a viable solution we will submit a new issue with the details.
We would like to share our repeating group definitions across multiple messages. We have tried modelling this as having repeating groups with each having one entry and that entry being a composite, however composites are much more restrictive than repeating groups.
The motivation is we have some shared entities which are present in repeating groups in multiple messages, but currently each one is scoped by its own enclosing message and the same codec is generated multiple times. As a consequence, our application has several areas of duplicated code to deal with several identical codecs.
Related to #47 and #13.
Sample schema to demostrate the idea using a new type called
component
which should provide the same flexibility as a repeating group (fixed length fields, nested groups, variable length data) to define the structure of a group entry: