iNTERFACEWARE Products Manual > Installing and Using Chameleon > Language API Documentation > C# .NET Support > The Engine Class |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
If you are using the static interface with Chameleon, your project must define an application Engine class. This class must inherit from the generated <prefix>Engine class in the stubcode private DLL which in turn is a child of the iNTERFACEWARE.Chameleon.Engine class. The following diagram shows the relationship: This class can be called anything that the developer chooses, typically something such as ApplicationEngine would be a good choice. There is no limit to the number of engine objects that can be instantiated in each application. It might be helpful to have one engine instance to handle ACKnowledgements, another to pre-sort incoming messages into different types and so on. There are several steps that need to be followed to set up the Engine object:
The following code fragment shows how you would typically create an Engine object:
The Chameleon C# framework supports the idea of a Log interface which consists of a single method Println(string line). This abstraction allows any object to implement the Log interface. The Log interface is explained in detail in this section of the documentation.
The stubcode Engine class has one virtual method for each message defined in the message definition file. Each function must be overridden by the user to implement the business logic required for the interface:
Each of these message virtual functions has two parameters:
The message object is a generated class which has methods for retrieving the tables that make up each message. Each table object has methods to get and set the column values in the table. These classes are described in the next section. Transport is an abstract interface which can be used to send an ACKnowledgement message back to the original source of the message. It is designed to allow the server code to be coded independently of the actual source of the messages.. |