Subsections


Component tools

Figure 1.1: Parts of the CCM Tools package.
\includegraphics[width=14cm]{ToolsOverview}

To help the component developer, the CCM Tools provide the tools shown in Figure 1.1. These tools include the parts described below.

CCM Metamodel Library

The CCM specification defines a metamodel for the IDL3 syntax. This metamodel is a set of classes that are capable of representing the syntactic elements in IDL3. We implemented a metamodel library in Java that allows creation of, and navigation through, CCM models. Using this library we can clearly separate the parser and the code generators, using a CCM model as the communication between the two parts. The parser creates a model object for every part of the source code matching an IDL grammar rule, and the generator tools read the model to generate code. Chapter 2 describes the CCM Tools' construction of the CCM metamodel library.

IDL3 Parser

The IDL3 Parser reads an IDL3 file, checks the syntax of the IDL source code and creates a CCM model, using the CCM metamodel library, in memory. This CCM model is the starting point for all code generator tools. Chapter 3 describes the IDL3 parser in detail.

Local C++ Component Generator

The CCM Tools include a generator tool that creates the local component logic from a given CCM model. The generated code contains C++ implementations of a component that can run in the same address space (hence called a `local component'). This implementation includes operations for providing, using, connecting, and disconnecting components and their facets. These generated operations are referred to as component logic. After generating the component logic, the component developer needs to write the business logic; that is, the functional implementation of the component so that it becomes useful in a component based software system. See Chapter 4 for more information about the component generator library.

Mirror Component Generators

After building a component it is a good idea to run a set of functional tests on it. Such testing can provide helpful component specific debugging and prevent large, difficult to locate, system bugs later in development.

To provide a test environment for every component, the CCM Tools can create a mirror component (a facet becomes a receptacle and vice versa) described in a mirror IDL3 file. We use the C++ component generators with the mirror IDL3 files to generate the code for mirror components. Then we use a C++ mirror test generator to create a basic test executable that connects each component with its mirror and calls the functions available for each component.

IDL2 Generator

To implement CORBA components, IDL3 source code needs to be reduced to IDL2, which can be interpreted by classic IDL compilers. The transformation from IDL3 to IDL2 also adds some operations needed for navigation between components and their ports (equivalent operations). The CCM Tools support this transformation using an IDL2 generator tool that creates IDL2 code based on a CCM model.

Remote C++ Component Generator

Note that the local components can only be used in a common address space and must be implemented in the same programming language. To overcome these limitations, the CCM Tools have a remote component generator that produces C++ code to interface the local components with CORBA. The remote component logic is thus a superset of the local component logic.

Component Descriptor Generator

To describe the component for the deployment and assembling processes, the OMG defines a CORBA Component Descriptor (CCD) file. This is an XML file containing a short description of a component and its ports. We map the CCM model to an XML-DOM tree that can be written as an XML file. The CCD file is also used by the code generators to get some additional information about the components being generated (version, vendor, etc.).

UML Parser

Optionally, the description of the component's interfaces can be contained in a UML diagram. We need a UML parser that reads the UML-XMI file, builds a UML model (based on the UML metamodel defined by the OMG) and transposes the model to a standard IDL3 file. The CCM Tools can use the NSUML UML metamodel library from NovoSoft, but the OMG has not yet defined an UML profile for the CCM. Thus a UML tool will likely be on the back burner for some time.

Component Packaging Tool

After generating and writing the component logic and the component descriptor file, we have to package these files into a zip file called, predictably, a component package. The component packaging tool provides these functionalities to the component developer.

Component Deployment Tool

On the target host the component package must be unzipped and the component must be deployed in the application server. The component deployment tools provide these functionalities to the component deployer.

2003-11-09