Saturday, March 31, 2007

QuickFix and Enums

It seems that the latest version of QuickFix has a .NET assembly and FIX 4.4 support, so I am going to be using it in an OMS demo that I am putting together to show off my .NET client-side framework.

One thing that I wish that the QuickFix guys did was to use enums instead of static const chars. For example, here is the definition of the OrdType class (this class is written in Managed C++, but a lot of the other .NET classes are in C#).

public __gc class OrdType : public CharField
static const int FIELD = 40;
static const __wchar_t MARKET = '1';
static const __wchar_t LIMIT = '2';
static const __wchar_t STOP = '3';
static const __wchar_t STOP_LIMIT = '4';

OrdType() : CharField(40) {}
OrdType(__wchar_t data) : CharField(40, data) {}

I completely understand why they used const chars, but for data-binding purposes, it is easier for me to use enums.

I wonder if I should reflect over a few classes and translate these classes to corresponding enumerated types.

I'm supposed to be a manager .. I have to find other people to do this kind of stuff for me. However, in my group, I am the only .NET person in a vast sea of Java-ness.

©2007 Marc Adler - All Rights Reserved

No comments: