Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
278 views
in Technique[技术] by (71.8m points)

fix protocol - Difference between "group" and "component" in QuickFIX/J

I am new to the FIX world. I am writing an application processing FIX messages in Java and for that I am using QuickFIX/J. I have downloaded the DataDictionary from the homepage (http://quickfixengine.org/). I am using the version 4.4.

In the XML-file exist groups and components. But a component can contain groups again.

What's the exact difference between them?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Components aren't really... things. They're like macros in the FIX DataDictionary (DD). Many messages need the same set of fields, so instead of specifying the same fields in every message, the DD defines a component that other messages can include.

A Group, on the other hand, is a very real thing. It's a repeating sequence of fields that will appear 0 or more times in a message.

QuickFIX's (QF) programming interface largely ignores components as a concept. You can't extract a component from a message because a component isn't a concept in QF; you just extract the fields like any other field.

A hypothetical example: The following two message definitions are exactly the same.

  1. With a component

    <message name="Automobile" msgtype="X" msgcat="app">
      <field name="Wheel" required="Y"/>
      <field name="Bumper" required="Y"/>
      <component name="Dashboard" required="Y"/>
    </message>
    
    <component name="Dashboard">
      <field name="Radio" required="Y"/>
      <field name="AirConditioner" required="Y"/>
      <field name="Heater" required="Y"/>
    </component>
    
  2. Without a component

    <message name="Automobile" msgtype="X" msgcat="app">
      <field name="Wheel" required="Y"/>
      <field name="Bumper" required="Y"/>
      <field name="Radio" required="Y"/>
      <field name="AirConditioner" required="Y"/>
      <field name="Heater" required="Y"/>
    </message>
    

See? A component is pretty much just a macro.

Either way it's defined, you just end up calling msg.GetHeater() (or whatever).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...