Chapter 16 Creating CORBA C++ Components


Procedure for creating C++ components

This section contains an overview of the steps involved in creating C++ components; the remainder of this chapter includes detailed information for each step. You use Jaguar Manager to define basic information (such as the component name and methods) about a C++ component, and generate files that are required to write the component's class implementation and to compile the class into a dynamic link library (on NT) or shared library (on UNIX).

You write your component as a C++ class; the generated files include a class implementation template in which you can write your method logic. In addition, Jaguar supplies an application programming interface that contains classes and methods that you can use to perform Jaguar-specific tasks. You can use the Jaguar API to write code to handle errors, cache connections to third-tier database servers, return result sets, manage transactions, share data between instances of the same component, retrieve a client's SSL certificate information, and make intercomponent calls.

After writing the method logic in the class implementation template, you install the component's dynamic link library (DLL) or shared library on a Jaguar server. Once the DLL or shared library is installed on a Jaguar server, a client can execute the component's methods in the DLL or shared library. Throughout the rest of this chapter, a C++ component is referred to as a component.

Detailed information for creating components is in these sections:

  1. Defining C++ components - Use Jaguar Manager to specify the component's name, DLL name, C++ class, method prototypes, and how transactions and instances are managed. This information is used to automatically generate the files necessary to compile the C++ component (including source files, makefiles and a Microsoft Visual C++ module definition file) into a DLL or shared library.
  2. Generating required C++ files - Required C++ files include the C++ source files (method skeletons file, class header file, class implementation template, and stub file) that are compiled into the component, a UNIX or NT makefile, and a Microsoft Visual C++ module definition file.
  3. Writing the class implementation - In the class implementation template, write the logic for each method.
  4. Compiling source files - Compile and link the class header file, the class implementation template, method skeletons file, stub file, and Jaguar DLL or shared libraries to create a DLL or shared library. You use makefiles and Microsoft Visual C++ module definition files to compile the C++ source files into a DLL or shared library.
  5. Installing the Component DLL or Shared Library - Copy the DLL or shared library to the cpplib directory of the Jaguar installation.

 


Copyright © 2000 Sybase, Inc. All rights reserved.