Skip to content

Commit 0e86429

Browse files
authored
Merge pull request #46 from donmendelson/v2-0-issue35
Better distinction between encoding type and field
2 parents 1903232 + 2a6d284 commit 0e86429

File tree

7 files changed

+286
-336
lines changed

7 files changed

+286
-336
lines changed

v2-0-RC1/doc/01Introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ and data examples.
137137
This is a sample encoding specification
138138

139139
```xml
140-
<type name="short" primitiveType="int16" semanticType="int" />
140+
<type name="short" primitiveType="int16"/>
141141
```
142142

143143
This is sample data as it would be transmitted on the wire
@@ -149,7 +149,7 @@ References
149149

150150
### Related FIX Standards
151151

152-
*Simple Open Framing Header*, FIX Protocol, Limited. Release Candidate 1
152+
*Simple Open Framing Header*, FIX Protocol, Limited. Version 1.0 Draft Standard
153153
specification has been published at
154154
<http://www.fixtradingcommunity.org/>
155155

v2-0-RC1/doc/02FieldEncoding.md

Lines changed: 36 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@ and message schema but are introduced here as an overview.
1111

1212
### Semantic data type
1313

14-
The FIX semantic data type of a field tells a data domain in a broad
15-
sense, for example, whether it is numeric or character data, or whether
16-
it represents a time or price. Simple Binary Encoding represents all of
14+
The FIX semantic data type of a field tells a data domain interpreted at the application layer, for example, whether it is numeric or character data, or whether it represents a time or price. Simple Binary Encoding represents all of
1715
the semantic data types that FIX protocol has defined across all
1816
encodings. In message specifications, FIX data type is declared with
1917
attribute semanticType. See the section 2.2 below for a listing of those
2018
FIX types.
2119

2220
### Encoding
2321

24-
Encoding tells how a field of a specific data type is encoded on the
25-
wire. An encoding maps a FIX data type to either a simple, primitive
22+
Encoding tells how a data element is encoded on the wire. Encoding belongs strictly to the presentation layer. It is context-free and carries no business semantics.
23+
24+
An encoding maps a FIX data type to either a simple, primitive
2625
data type, such as a 32 bit signed integer, or to a composite type. A
2726
composite type is composed of two or more simple primitive types. For
2827
example, the FIX data type Price is encoded as a decimal, a composite
@@ -142,17 +141,10 @@ Attributes are optional unless specified otherwise.
142141
| maxValue | The highest valid value of a range (inclusive unless specified otherwise). Applies to scalar data types, but not to String or data types. |
143142
| semanticType | Tells the FIX semantic type of a field or encoding. It may be specified on either a field or its encoding. |
144143

145-
### Inherited attributes
146-
147-
The attributes listed above apply to a field element or its encoding
148-
(wire format). Any attributes specified on an encoding are inherited by
149-
fields that use that encoding.
150-
151144
### Non-FIX types
152145

153146
Encodings may be added to SBE messages that do not correspond to listed
154-
FIX data types. In that case, the encoding and fields that use the
155-
encoding will not have a semanticType attribute.
147+
FIX data types. In that case, the fields that use the encoding will not have a semanticType attribute.
156148

157149
Integer encoding
158150
-------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -386,17 +378,17 @@ FIX Qty data type is a float type, but a decimal may be constrained to
386378
integer values by setting exponent to zero.
387379

388380
```xml
389-
<composite name="intQty32" semanticType="Qty">
381+
<composite name="intQty32">
390382
<type name="mantissa" primitiveType="int32" />
391383
<type name="exponent" primitiveType="int8"
392384
presence="constant">0</type>
393385
</composite>
394386
```
395387

396-
Field inherits semanticType from encoding
388+
A field uses the encoding and adds semanticType.
397389

398390
```xml
399-
<field type="intQty32" name="OrderQty" id="38"
391+
<field type="intQty32" name="OrderQty" id="38" semanticType="Qty"
400392
description="Total number of shares" />
401393
```
402394

@@ -515,7 +507,7 @@ control character (code 0).
515507
This is the standard encoding for char type.
516508

517509
```xml
518-
<type name="char" primitiveType="char" semanticType="char" />
510+
<type name="charType" primitiveType="char"/>
519511
```
520512

521513
Wire format of char encoding of "A" (ASCII value 65, hexadecimal 41)
@@ -553,10 +545,9 @@ encoding.
553545
A typical string encoding specification
554546

555547
```xml
556-
<type name="string6" primitiveType="char" semanticType="String"
557-
length="6" />
548+
<type name="string6" primitiveType="char" length="6" />
558549

559-
<field type="string6" name="Symbol" id="55" />
550+
<field type="string6" name="Symbol" id="55" semanticType="String"/>
560551
```
561552

562553
Wire format of a character array in character and hexadecimal formats
@@ -568,11 +559,10 @@ M S F T
568559
A character array constant specification
569560

570561
```xml
571-
<type name="EurexMarketID" semanticType="Exchange"
572-
primitiveType="char" length="4" description="MIC code"
562+
<type name="EurexMarketID" primitiveType="char" length="4" description="MIC code"
573563
presence="constant">XEUR</type>
574564

575-
<field type="EurexMarketID" name="MarketID" id="1301" />
565+
<field type="EurexMarketID" name="MarketID" id="1301" semanticType="Exchange"/>
576566
```
577567

578568
### Variable-length string encoding
@@ -628,9 +618,9 @@ Encoding specification for variable length data up to 65535 octets
628618

629619
```xml
630620
<composite name="varString" description="Variable-length string">
631-
<type name="length" primitiveType="uint16" semanticType="Length"/>
621+
<type name="length" primitiveType="uint16"/>
632622
<type name="data" length="0" primitiveType="uint8"
633-
semanticType="data" characterEncoding="UTF-16"/>
623+
characterEncoding="UTF-16"/>
634624
</composite>
635625

636626
<data name="SecurityDesc" id="107" type="varString"/>
@@ -743,8 +733,8 @@ Encoding specification for variable length data up to 65535 octets
743733

744734
```xml
745735
<composite name="DATA" description="Variable-length data">
746-
<type name="length" primitiveType="uint16" semanticType="Length"/>
747-
<type name="data" length="0" primitiveType="uint8" semanticType="data" />
736+
<type name="length" primitiveType="uint16"/>
737+
<type name="data" length="0" primitiveType="uint8"/>
748738
</composite>
749739

750740
<data name="RawData" id="96" type="DATA"/>
@@ -797,7 +787,7 @@ required and optional elements.
797787
The standard encoding specification for MonthYear
798788

799789
```xml
800-
<composite name="monthYear" semanticType="MonthYear">
790+
<composite name="monthYear">
801791
<type name="year" primitiveType="uint16" presence="optional"
802792
nullValue="65536" />
803793
<type name="month" primitiveType="uint8" minValue="1" maxValue="12" />
@@ -810,7 +800,9 @@ The standard encoding specification for MonthYear
810800

811801
Example MonthYear field specification
812802

813-
<field type="monthYear" name="MaturityMonthYear" id="200" />
803+
```xml
804+
<field type="monthYear" name="MaturityMonthYear" id="200" semanticType="MonthYear"/>
805+
```
814806

815807
Wire format of MonthYear 2014 June week 3 as hexadecimal
816808

@@ -869,7 +861,7 @@ Enumeration of time units:
869861
Timestamp with variable time units:
870862

871863
```xml
872-
<composite name="UTCTimestamp" description="UTC timestamp with precision on the wire" semanticType="UTCTimestamp" >
864+
<composite name="UTCTimestamp" description="UTC timestamp with precision on the wire">
873865
<type name="time" primitiveType="uint64" />
874866
<type name="unit" primitiveType="uint8" />
875867
</composite>
@@ -878,7 +870,7 @@ Timestamp with variable time units:
878870
Timestamp with constant time unit:
879871

880872
```xml
881-
<composite name="UTCTimestampNanos" description="UTC timestamp with nanosecond precision" semanticType="UTCTimestamp" >
873+
<composite name="UTCTimestampNanos" description="UTC timestamp with nanosecond precision">
882874
<type name="time" primitiveType="uint64" />
883875
<type name="unit" primitiveType="uint8" presence="constant" valueRef="TimeUnit.nanosecond" />
884876
</composite>
@@ -887,7 +879,7 @@ Timestamp with constant time unit:
887879
Time only with variable time units:
888880

889881
```xml
890-
<composite name="UTCTime" description="Time of day with precision on the wire" semanticType="UTCTimeOnly" >
882+
<composite name="UTCTime" description="Time of day with precision on the wire">
891883
<type name="time" primitiveType="uint64" />
892884
<type name="unit" primitiveType="uint8" />
893885
</composite>
@@ -896,7 +888,7 @@ Time only with variable time units:
896888
Time only with constant time unit:
897889

898890
```xml
899-
<composite name="UTCTimeNanos" description="Time of day with millisecond precision" semanticType="UTCTimeOnly" >
891+
<composite name="UTCTimeNanos" description="Time of day with millisecond precision">
900892
<type name="time" primitiveType="uint64" />
901893
<type name="unit" primitiveType="uint8" presence="constant" valueRef="TimeUnit.millisecond" />
902894
</composite>
@@ -905,7 +897,7 @@ Time only with constant time unit:
905897
Date only specification:
906898

907899
```xml
908-
<type name="date" primitiveType="uint16" semanticType="UTCDateOnly" />
900+
<type name="date" primitiveType="uint16"/>
909901
```
910902

911903
### Examples of date/time fields
@@ -915,7 +907,7 @@ hours, 17 minutes and 22 seconds since the UNIX epoch) with default
915907
schema attributes
916908

917909
```xml
918-
<composite name="UTCTimestampNanos" description="UTC timestamp with nanosecond precision" semanticType="UTCTimestamp" >
910+
<composite name="UTCTimestampNanos" description="UTC timestamp with nanosecond precision">
919911
<type name="time" primitiveType="uint64" />
920912
<type name="unit" primitiveType="uint8" presence="constant" valueRef="TimeUnit.nanosecond" />
921913
</composite>
@@ -930,7 +922,7 @@ byte order
930922
since midnight UTC) with default schema attributes
931923

932924
```xml
933-
<composite name="UTCTimeOnlyNanos" description="UTC time of day with nanosecond precision" semanticType="UTCTimeOnly" >
925+
<composite name="UTCTimeOnlyNanos" description="UTC time of day with nanosecond precision">
934926
<type name="time" primitiveType="uint64" />
935927
<type name="unit" primitiveType="uint8" presence="constant" valueRef="TimeUnit.nanosecond" />
936928
</composite>
@@ -944,7 +936,7 @@ Wire format of UTCTimeOnly
944936
default schema attributes
945937

946938
```xml
947-
<type name="date" primitiveType="uint16" semanticType="UTCDateOnly" />
939+
<type name="date" primitiveType="uint16"/>
948940
```
949941

950942
Wire format of UTCDateOnly
@@ -964,7 +956,7 @@ time at the market instead of UTC time.
964956
The standard encoding specification for LocalMktDate
965957

966958
```xml
967-
<type name="localMktDate" primitiveType="uint16" semanticType="LocalMktDate" />
959+
<type name="localMktDate" primitiveType="uint16"/>
968960
```
969961

970962
Local time encoding
@@ -997,7 +989,7 @@ elements within the composite encoding. See section 4.4.4.3 below.
997989
Standard TZTimestamp encoding specification
998990

999991
```xml
1000-
<composite name="tzTimestamp" semanticType="TZTimestamp">
992+
<composite name="tzTimestamp">
1001993
<type name="time" primitiveType="uint64" />
1002994
<type name="unit" primitiveType="uint8" />
1003995
<!-- Sign of timezone offset is on hour subfield -->
@@ -1036,7 +1028,7 @@ elements within the composite encoding. See section 4.4.4.3 below.
10361028
Standard TZTimeOnly encoding specification
10371029

10381030
```xml
1039-
<composite name="tzTimeOnly" semanticType="TZTimeOnly">
1031+
<composite name="tzTimeOnly">
10401032
<type name="time" primitiveType="uint64" />
10411033
<type name="unit" primitiveType="uint8" />
10421034
<!-- Sign of timezone offset is on hour subfield -->
@@ -1169,13 +1161,7 @@ Standard encoding specifications for required and optional Boolean
11691161
fields
11701162

11711163
```xml
1172-
<enum name="booleanEnum" encodingType="uint8" semanticType="Boolean">
1173-
<validValue name="false">0</validValue>
1174-
<validValue name="true">1</validValue>
1175-
</enum>
1176-
1177-
<enum name="optionalBoolean" encodingType="uint8" presence="optional"
1178-
nullValue="255" semanticType="Boolean">
1164+
<enum name="booleanEnum" encodingType="uint8">
11791165
<validValue name="false">0</validValue>
11801166
<validValue name="true">1</validValue>
11811167
</enum>
@@ -1184,7 +1170,9 @@ fields
11841170
Example optional Boolean field
11851171

11861172
```xml
1187-
<field type="optionalBoolean" name="SolicitedFlag" id="377" />
1173+
<field type="requiredBoolean" name="SolicitedFlag" id="377" presence="required" semanticType="Boolean" />
1174+
1175+
<field type="optionalBoolean" name="SolicitedFlag" id="377" presence="optional" nullValue="255" semanticType="Boolean" />
11881176
```
11891177

11901178
Wire format of true value as hexadecimal

v2-0-RC1/doc/03MessageStructure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ Recommended encoding of repeating group dimensions
439439
```xml
440440
<composite name="groupSizeEncoding">
441441
<type name="blockLength" primitiveType="uint16"/>
442-
<type name="numInGroup" primitiveType="uint16" semanticType="NumInGroup"/>
442+
<type name="numInGroup" primitiveType="uint16"/>
443443
<type name="numGroups" primitiveType="uint16" />
444444
<type name="numVarDataFields" primitiveType="uint16" />
445445
</composite>
@@ -454,7 +454,7 @@ any repeating groups or variable-length fields.
454454

455455
The number of entries in this repeating group, called NumInGroup in FIX.
456456

457-
##### Number of repeating groups
457+
#### Number of repeating groups
458458

459459
A count nested repeating groups in this repeating group.
460460

@@ -473,7 +473,7 @@ The occurrences of a repeating group may be restricted to a specific range by mo
473473
Example of a restricted group encoding
474474

475475
```xml
476-
<type name="numInGroup" primitiveType="uint16" semanticType="NumInGroup" minValue="1" maxValue="10" />
476+
<type name="numInGroup" primitiveType="uint16" minValue="1" maxValue="10" />
477477
```
478478

479479
Sequence of message body elements

0 commit comments

Comments
 (0)