Introduction
This tutorial shows one how to use the CORBA Application Wizard by creating a simple application that will simulate a Stock Quoter. I will assume that you know how to create a new project using Application Wizards and have already provided an appropriate name for your project. I will also assume that you have some knowledge about CORBA.
This tutorial is based on the online tutorial that is included with the TAO source code. A big THANK YOU has to go to Doug Schmidt for giving me permission to use the code found in this tutorial.
Initially this tutorial was to consist of just one part but with the increasing length of the tutorial it was decided to divide the tutorial into two parts. This is part one and takes one through all the steps of the application wizard. Part two is found here and deals with completing the Stock Quoter application.
Step 1
For this tutorial we will create a simple console application. So we will select the Console Application
option and then press the Next
button to move onto Step 2. The other two options MFC Application
and Win32 Application
aren't yet fully functional.
Step 2
Actually we need to create two applications. One application will act as the server while the other application will act as the client. We will first create the server by selecting the Server
option. Selecting the Client
option will create a client application, while selecting the Server and Client
will result in your application acting as both a server and a client. After we have created the server application we will then need to run the CORBA Application Wizard again and create a client application.
Selecting the debug version will cause the application to be linked with the debug versions of the TAO-associated libraries.
(Coming to think of it, I am wondering if I should give the user the option of having the individual server and client applications being created at the same time to save the user of having to run the AppWizard again.)
Step 3
I have entered a module name Quoter
that will result in all the interfaces being included in a single idl file, namely Quoter.idl. Leaving out a module name will result in each interface being placed in its own .idl file. I have also named the interfaces to be created: Stock
and StockFactory
. The Quoter.idl file will contain the following code immediately after creation:
#ifndef Quoter_module
#define Quoter_module
module Quoter
{
interface Stock
{
};
interface StockFactory
{
};
};
#endif //Quoter_module
The Stock
interface will be used to query the prices of stock whereas the StockFactory
interface will be used to "gain access to the Stock object references from their symbols". For a more detailed description about the Quoter Application see the "Building a Stock Quoter with TAO" tutorial by Carlos O'Ryan.
Step 4
We don't have to worry about anything here, so just click on the Next button.
Step 5
To keep this tutorial simple, use will be made of an Interoperable Object Reference (IOR) string. The transfer of the IOR string between the server and the client will be done using a file. I'll show you how this can be done at the end of the second part of this tutorial.
Step 6
Here we will make use of the Static Invocation Interface. For this tutorial, this is the easiest. Now we have reached the end of the steps and are ready to create the application. So click on the Finish button. The application framework will now be generated and displayed on the Visual Studio IDE. Now repeat the above steps but in step 2 select the client option instead of the server option. To complete the application go to the second part of this tutorial.
History
- 3 November 2003 - First public release.
I am a qualified Veterinary Surgeon who prefers treating computers with viruses than animals with viruses. I have recently completed a MEng German Informatics degree at the University of Reading with a 2:1. I also have the ISEB Foundation Certificate in Software Testing.
Currently I am umemployed and desparately looking for a job in the IT industry.