User can compile FIX schemas into .Net assemblies or Java source code. The assemblies or Java code contain the constants of FIX field tags, field valid values and message types. The compiled schemas can be used to build applications with QWFIX SDK. The Visual Studio intellisense and Java development tools such as Eclipse will work with the compiled schemas to help programmers build clearer and more robust code.
In order to compile schemas, first, select a repository in the "Repository Explorer" tool window. Then go to "Tools" -> "Compile Schemas" in the main menu. A schema compiler dialog will pop up.
All FIX schemas defined in the selected repository will be displayed in a tree view in the dialog. First of all, user needs to specify the output platform/format. Currently two platforms are supported .Net and Java.
User also needs to supply an output directory for the compiled assembly files. It can be done by clicking the "Browse" button and then select a folder from folder browser dialog.
Users are also required to select the schemas then want to compile from the tree view. Note a standard schema is always selected if a inherited schema is selected. For example: selecting the schema "TEST44" will select "FIX44" as well.to specify the output platform/format. Currently two platforms are supported .Net and Java.
user needs to supply an output directory for the compiled assembly files. It can be done by clicking the "Browse" button and then select a folder from folder browser dialog.
The compiled schemas contains the constants of the definitions of field tags, field valid values and message types. By using the compiled schemas, developers can use constant names instead of values. For example, user can use Tags.ClOrdID in program source code instead of a constant value of "11".
The compiled .Net assemblies will have a namespace of "Teraspaces.QWFIX.DynSchema.*". For example, a schema named "FIX44" (the standard schema of FIX 4.4) will be compiled into an assembly with namespace of "Teraspaces.QWFIX.DynSchema.FIX44". The assembly will have a file name "Teraspaces.QWFIX.DynSchema.FIX44.dll".<".
The compiled Java code will have a package name of "com.teraspaces.qwfix.schemas". Each schema is defined as a class with the same name. A sub directory of "com\teraspaces\qwfix\schemas" will be generated under the specified "output" directory. In eclipse, the "output" directory is usually a directory with name "src".
The compilation only includes the incremental changes. In the compiled assemblies of FIX schemas derived from a standard schema, only definition of new fields, modified field valid value sets and new message types are included. By making the contents in assemblies incremental, developers can always be disciplined and be aware of the constraints enforced in the new schemas.
The compiled assemblies can be directly referenced by .Net projects. For example, user can add the compiled assembly "Teraspaces.QWFIX.DynSchema.FIX44.dll" into the reference list of the project. The Visual Studio has a feature called "intellisense" which helps programmers to complete statements in code based on the type names they typed.
In the following screen shot, the program referenced the compiled assembly of "FIX44". When the developer typed "ValidValues.ExecType.", a box will pop up with all possible valid values defined for the field "ExecType" for user to choose from.
Similarily, the generated Java code can be imported as Java source code in Eclipse. The Java source code can be compiled into jar file and be used by other projects.