“组"与“组"之间的区别在于:和“组件"在QuickFIX/J中 [英] Difference between "group" and "component" in QuickFIX/J

查看:163
本文介绍了“组"与“组"之间的区别在于:和“组件"在QuickFIX/J中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是FIX世界的新手.我正在编写一个使用Java处理FIX消息的应用程序,为此我正在使用QuickFIX/J.我已经从主页( http://quickfixengine.org/)下载了DataDictionary.我正在使用版本4.4.

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.

在XML文件中存在组和组件.但是组件可以再次包含组.

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

它们之间的确切区别是什么?

What's the exact difference between them?

推荐答案

组件不是真正的东西.它们就像FIX DataDictionary(DD)中的宏.许多邮件都需要相同的字段集,因此DD定义了其他邮件可以包含的组件,而不是在每封邮件中都指定相同的字段.

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.

另一方面,一个团体是非常真实的事情.这是一个重复的字段序列,将在一条消息中出现0次或多次.

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(QF)编程接口在很大程度上忽略了组件的概念.您不能从消息中提取组件,因为组件不是QF中的概念.您只需像其他任何字段一样提取字段即可.

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. 带有组件

  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>

  • 没有组件

  • 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.

    无论用哪种方式定义,您都只需要调用msg.GetHeater()(或其他任何方法)即可.

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

    这篇关于“组"与“组"之间的区别在于:和“组件"在QuickFIX/J中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆