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?
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.
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>
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).
Thank your very much!!! Very good explanation! Can you explain me how QuickFix(/J) knows what fields contain to a group? For example the component "Parties" has only one element: Group "NoPartyIDs". I know what this group is.. In the FIX44.xml (downloaded from quickfixengine.org) file there appears the word "NoPartyIDs" only twice. Once in the definition of the component "Parties" (line 2416) and the definition of the field (line 5217). How knows Java the fields of the group "NoPartyIDs"? Would be better if the xml-file would has a <groups>-tag where the group would be defined?!
Um... "NoPartyIDs" is a group tag. And it contains the group's fields.
Yes.. But this isn't defined in the XML-File, isn't it? So it has to be defined in some Java classes in the QuickFix implementation?!
I'm looking at it in the FIX44.xml file right now. Inside
<component name="Parties">
is the NoPartyIDs group, which contains PartyID, PartyIDSource, PartyRole, and the NoPartySubIDs group.