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.
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.
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.)
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:
StockFactory. The Quoter.idl file will contain the following code immediately after creation:
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.
We don't have to worry about anything here, so just click on the Next button.
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.
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.
- 3 November 2003 - First public release.