Chapter 14: Creating CORBA C++ Components  Defining C++ components

Chapter 14: 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 EAServer 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 Windows) 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, EAServer supplies an application programming interface that contains classes and methods that you can use to perform EAServer-specific tasks. You can use the EAServer 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 compile the component to build a dynamic link library (DLL) or shared library, then deploy the librar to your EAServer installation.

Detailed information for creating components is in these sections:

  1. Defining C++ components – use EAServer 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 – use EAServer Manager to generated the source files and the makefiles for UNIX and Windows.

  3. Writing the class implementation – in the class implementation template, write the logic for each method.

  4. Compiling source files – Compile and link source files to create 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 EAServer installation.

Copyright © 2005. Sybase Inc. All rights reserved. Defining C++ components