dictionary inheritance

Imported from previous forum

I am new to FAST and want to define the template inheritance. I have following questions

  1. Do we need to define the “global” dictionary template ?
    my understanding: I dont think so !

  2. do we need to define the reference template by itself or the FAST code should build by itself.
    my understanding: Fast code should by itself

  3. If I want to use only copy code and increment code operators. Is there any difference between FAST 1.0 and 1.1 ?
    my understanding: for these two operator there is no change in the updated spec

  4. Can someone clarify my understanding of following template definition ?

(template name=”T1” )
(typeRef name=”t4”)
(string name=”Field1” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field2” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field3” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(string name=”Field4” presence=”mandatory”)
(copy dictionary=”template”)
(/string)
(/template)

(template name=”T2” )
(typeRef name=”t4”)
(string name=”Field2” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field3” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field4” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(string name=”Field5” presence=”mandatory”)
(copy dictionary=”template”)
(/string)
(/template)

(template name=”T3”)
(typeRef name=”t4”)
(string name=”Field3” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field4” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field5” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(string name=”Field6” presence=”mandatory”)
(copy dictionary=”template”)
(/string)
(/template)

(template name=”T3”)
(typeRef name=”t4”)
(string name=”Field4” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field5” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field6” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(string name=”Field7” presence=”mandatory”)
(copy dictionary=”template”)
(/string)
(/template)

Following is my understanding is:
Template1:
T1.field1 global
T1.field2 global
T1.field3 t4
T1.field4 T1

Template2:
T2.field2 global
T2.field3 global
T2.field4 t4
T2.field5 T2

Template3:
T3.field3 global
T3.field4 global
T3.field5 t4
T3.field6 T3

Template4:
T4.field4 global
T4.field5 global
T4.field6 t4
T4.field7 T4

  1. In the above example if I use templateRef instead of typeRef what is the difference ?
    my understanding : nothing !

can some one clarify my doubts please.

Thanks,
Rup

I am new to FAST and want to define the template inheritance. I have
following questions

  1. Do we need to define the “global” dictionary template ? my
    understanding: I dont think so !

  2. do we need to define the reference template by itself or the
    FAST code should build by itself. my understanding: Fast code
    should by itself

  3. If I want to use only copy code and increment code operators. Is
    there any difference between FAST 1.0 and 1.1 ? my understanding: for
    these two operator there is no change in the updated spec

  4. Can someone clarify my understanding of following template
    definition ?

(template name=”T1” ) (typeRef name=”t4”) (string name=”Field1”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field2” presence=”mandatory”) (copy dictionary=”global”) (/string)
(string name=”Field3” presence=”mandatory”) (copy dictionary=”type”)
(/string) (string name=”Field4” presence=”mandatory”) (copy
dictionary=”template”) (/string) (/template)

(template name=”T2” ) (typeRef name=”t4”) (string name=”Field2”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field3” presence=”mandatory”) (copy dictionary=”global”) (/string)
(string name=”Field4” presence=”mandatory”) (copy dictionary=”type”)
(/string) (string name=”Field5” presence=”mandatory”) (copy
dictionary=”template”) (/string) (/template)

(template name=”T3”) (typeRef name=”t4”) (string name=”Field3”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field4” presence=”mandatory”) (copy dictionary=”global”) (/string)
(string name=”Field5” presence=”mandatory”) (copy dictionary=”type”)
(/string) (string name=”Field6” presence=”mandatory”) (copy
dictionary=”template”) (/string) (/template)

(template name=”T3”) (typeRef name=”t4”) (string name=”Field4”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field5” presence=”mandatory”) (copy dictionary=”global”) (/string)
(string name=”Field6” presence=”mandatory”) (copy dictionary=”type”)
(/string) (string name=”Field7” presence=”mandatory”) (copy
dictionary=”template”) (/string) (/template)

Following is my understanding is: Template1:
T1.field1 global
T2.field2 global
T3.field3 t4
T4.field4 T1

Template2:
T5.field2 global
T6.field3 global
T7.field4 t4
T8.field5 T2

Template3:
T9.field3 global
T10.field4 global
T11.field5 t4
T12.field6 T3

Template4:
T13.field4 global
T14.field5 global
T15.field6 t4
T16.field7 T4

  1. In the above example if I use templateRef instead of typeRef what is
    the difference ? my understanding : nothing !
  1. See section 6.3.1 of the FAST Specification 1.1. It states that the default dictionary is the global dictionary. You’re correct that you don’t need to specify it explicitly.

  2. I’m not sure I understand your question here and what the FAST processor is supposed to handle automatically. If you refer to typeRef, then that is something you’ll have to add manually in the template definition. It affects the behavior of operators using the dictionary ‘type’. However, it doesn’t have a direct correspondence on the wire.

Other than affecting the behavior of operators, the primary purpose of the typeRef element is to indicate to the application what application type the template is a template for. If you have multiple templates for the same application type, then they should all share the same typeRef.

  1. The basic semantics of the copy and increment operators are the same in FAST 1.0 and FAST 1.1. However, in FAST 1.1 you can use dictionaries and explicit keys that make the operators behave in a way that wasn’t possible in FAST 1.0.

  2. Your mappings of dictionaries per field seems correct (assuming the second T3 template should have been T4)

  3. They’re fundamentally different. I’ve already described typeRef above. A templateRef is a reference to another template. If the templateRef has a name, a static reference, then you can think of it as the instructions of the referred template are inserted at the point of reference. If the templateRef don’t have a name, a dynamic reference, then a PMAP and template identifier are expected at the corresponding point in an encoded message. The template identifier then tells the decoder what lies and in effect starts a submessage on the wire. See section 6.4 in the specification for details.

/David

I am new to FAST and want to define the template inheritance. I have
following questions

  1. Do we need to define the “global” dictionary template ? my
    understanding: I dont think so !

  2. do we need to define the reference template by itself or the
    FAST code should build by itself. my understanding: Fast code
    should by itself

  3. If I want to use only copy code and increment code operators. Is
    there any difference between FAST 1.0 and 1.1 ? my understanding: for
    these two operator there is no change in the updated spec

  4. Can someone clarify my understanding of following template
    definition ?

(template name=”T1” ) (typeRef name=”t4”) (string name=”Field1”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field2” presence=”mandatory”) (copy dictionary=”global”) (/string)
(string name=”Field3” presence=”mandatory”) (copy dictionary=”type”)
(/string) (string name=”Field4” presence=”mandatory”) (copy
dictionary=”template”) (/string) (/template)

(template name=”T2” ) (typeRef name=”t4”) (string name=”Field2”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field3” presence=”mandatory”) (copy dictionary=”global”) (/string)
(string name=”Field4” presence=”mandatory”) (copy dictionary=”type”)
(/string) (string name=”Field5” presence=”mandatory”) (copy
dictionary=”template”) (/string) (/template)

(template name=”T3”) (typeRef name=”t4”) (string name=”Field3”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field4” presence=”mandatory”) (copy dictionary=”global”) (/string)
(string name=”Field5” presence=”mandatory”) (copy dictionary=”type”)
(/string) (string name=”Field6” presence=”mandatory”) (copy
dictionary=”template”) (/string) (/template)

(template name=”T3”) (typeRef name=”t4”) (string name=”Field4”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field5” presence=”mandatory”) (copy dictionary=”global”) (/string)
(string name=”Field6” presence=”mandatory”) (copy dictionary=”type”)
(/string) (string name=”Field7” presence=”mandatory”) (copy
dictionary=”template”) (/string) (/template)

Following is my understanding is: Template1:
T1.field1 global
T2.field2 global
T3.field3 t4
T4.field4 T1

Template2:
T5.field2 global
T6.field3 global
T7.field4 t4
T8.field5 T2

Template3:
T9.field3 global
T10.field4 global
T11.field5 t4
T12.field6 T3

Template4:
T13.field4 global
T14.field5 global
T15.field6 t4
T16.field7 T4

  1. In the above example if I use templateRef instead of typeRef what is
    the difference ? my understanding : nothing !

David,
Thank you very much for your reply. You are right about point 4 it should have been T4.

for the point2: What I am trying to explain is typeRef for all the message templates are “t4”. Now if I define a new message template “T5” with typeRef “t4” as follows:

(template name=”T5”)
(typeRef name=”t4”)
(string name=”Field1” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field2” presence=”mandatory”)
(copy dictionary=”global”)
(/string)
(string name=”Field3” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(string name=”Field4” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(string name=”Field5” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(string name=”Field6” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(string name=”Field7” presence=”mandatory”)
(copy dictionary=”type”)
(/string)
(/template)

The Questions are

  1. All the fields are copy operators so will it copy the previous instance of Following fields
    field3 from message template “T1”
    field4 from message template “T2”
    field5 from message template “T3”
    filed6 from message template “T4”

while encoding the messages in the same sequence as T1,T2,T3,T4,T5.

Regards,
Rup

  1. See section 6.3.1 of the FAST Specification 1.1. It states that the
    default dictionary is the global dictionary. You’re correct that you
    don’t need to specify it explicitly.

  2. I’m not sure I understand your question here and what the FAST
    processor is supposed to handle automatically. If you refer to
    typeRef, then that is something you’ll have to add manually in the
    template definition. It affects the behavior of operators using the
    dictionary ‘type’. However, it doesn’t have a direct correspondence
    on the wire.

Other than affecting the behavior of operators, the primary purpose of
the typeRef element is to indicate to the application what application
type the template is a template for. If you have multiple templates for
the same application type, then they should all share the same typeRef.

  1. The basic semantics of the copy and increment operators are the same
    in FAST 1.0 and FAST 1.1. However, in FAST 1.1 you can use
    dictionaries and explicit keys that make the operators behave in a
    way that wasn’t possible in FAST 1.0.

  2. Your mappings of dictionaries per field seems correct (assuming the
    second T3 template should have been T4)

  3. They’re fundamentally different. I’ve already described typeRef
    above. A templateRef is a reference to another template. If the
    templateRef has a name, a static reference, then you can think of it
    as the instructions of the referred template are inserted at the
    point of reference. If the templateRef don’t have a name, a dynamic
    reference, then a PMAP and template identifier are expected at the
    corresponding point in an encoded message. The template identifier
    then tells the decoder what lies and in effect starts a submessage on
    the wire. See section 6.4 in the specification for details.

/David

I am new to FAST and want to define the template inheritance. I have
following questions

  1. Do we need to define the “global” dictionary template ? my
    understanding: I dont think so !

  2. do we need to define the reference template by itself or the FAST
    code should build by itself. my understanding: Fast code should by
    itself

  3. If I want to use only copy code and increment code operators. Is
    there any difference between FAST 1.0 and 1.1 ? my understanding:
    for these two operator there is no change in the updated spec

  4. Can someone clarify my understanding of following template
    definition ?

(template name=”T1” ) (typeRef name=”t4”) (string name=”Field1”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field2” presence=”mandatory”) (copy dictionary=”global”)
(/string) (string name=”Field3” presence=”mandatory”) (copy
dictionary=”type”) (/string) (string name=”Field4”
presence=”mandatory”) (copy dictionary=”template”) (/string)
(/template)

(template name=”T2” ) (typeRef name=”t4”) (string name=”Field2”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field3” presence=”mandatory”) (copy dictionary=”global”)
(/string) (string name=”Field4” presence=”mandatory”) (copy
dictionary=”type”) (/string) (string name=”Field5”
presence=”mandatory”) (copy dictionary=”template”) (/string)
(/template)

(template name=”T3”) (typeRef name=”t4”) (string name=”Field3”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field4” presence=”mandatory”) (copy dictionary=”global”)
(/string) (string name=”Field5” presence=”mandatory”) (copy
dictionary=”type”) (/string) (string name=”Field6”
presence=”mandatory”) (copy dictionary=”template”) (/string)
(/template)

(template name=”T3”) (typeRef name=”t4”) (string name=”Field4”
presence=”mandatory”) (copy dictionary=”global”) (/string) (string
name=”Field5” presence=”mandatory”) (copy dictionary=”global”)
(/string) (string name=”Field6” presence=”mandatory”) (copy
dictionary=”type”) (/string) (string name=”Field7”
presence=”mandatory”) (copy dictionary=”template”) (/string)
(/template)

Following is my understanding is: Template1:
T1.field1 global
T2.field2 global
T3.field3 t4
T4.field4 T1

Template2:
T5.field2 global
T6.field3 global
T7.field4 t4
T8.field5 T2

Template3:
T9.field3 global
T10.field4 global
T11.field5 t4
T12.field6 T3

Template4:
T13.field4 global
T14.field5 global
T15.field6 t4
T16.field7 T4

  1. In the above example if I use templateRef instead of typeRef what
    is the difference ? my understanding : nothing !

Rup, the answer is yes.
(pls refer to section 6.3.1 of the spec)

/Rolf

your question as I parsed it:

given a message sequence m1, m2, m3, m4, m5 where
m1 uses T1, m2 uses T2, …

given that the following fields are present on the wire:
Field3 in m1, Field4 in m2, Field5 in m3, Field6 in m4

[these fields have entries in the type dictionary “t4” and the respective entries will be updated when encoding m1-m4]

given that the following fields are absent on the wire in m5:
Field3, Field4, Field5, Field6

will their values be copied from type dictionary “t4”?

  • m5.Field3 from t4.Field3 (updated by m1.Field3)
  • m5.Field4 from t4.Field4 (updated by m2.Field4)
  • m5.Field5 from t4.Field5 (updated by m3.Field5)
  • m5.Field6 from t4.Field6 (updated by m4.Field6)

Rolf,
Thank you very much for your response. This clears all my doubts. You guys are best.

Regards,
Rup

Rup, the answer is yes. (pls refer to section 6.3.1 of the spec)

/Rolf

your question as I parsed it:

given a message sequence m1, m2, m3, m4, m5 where m1 uses T1, m2
uses T2, …

given that the following fields are present on the wire: Field3 in m1,
Field4 in m2, Field5 in m3, Field6 in m4

[these fields have entries in the type dictionary “t4” and the
respective entries will be updated when encoding m1-m4]

given that the following fields are absent on the wire in m5: Field3,
Field4, Field5, Field6

will their values be copied from type dictionary “t4”?

  • m5.Field3 from t4.Field3 (updated by m1.Field3)
  • m5.Field4 from t4.Field4 (updated by m2.Field4)
  • m5.Field5 from t4.Field5 (updated by m3.Field5)
  • m5.Field6 from t4.Field6 (updated by m4.Field6)