# Preparing a new component implementation

I am documenting the steps required to prepare a component implementation. Personally, I prefer to set up a directory to contain only one component implementation. I believe the procedures outlined below will work if you have multiple component implementation in the same IDL files. The purpose of this document is to record the procedures and steps on how these files relate to each others and how they come about during the development process.

Assuming we need to create a new component called `Orc`. Below is the list of files you'll need to deal with. Our goal is to greatly reduce the number of files you need to deal with manually...

1. `Orc.idl` - This is the IDL file that contains the component and component home definitions.

   As you will eventually create 3 DLLs (or shared objects), you will also need 3 sets of different export macros files as following.

2. `Orc_stub_export.h` - This file is generated using the following command:

   `generate_export_file.pl ORC_STUB > Orc_stub_export.h`

   This file makes macros like `ORC_STUB_Export` and friends available. They are usually controlled by `ORC_STUB_BUILD_DLL`

3. `Orc_svnt_export.h` - This file is generated using the following command:

   `generate_export_file.pl ORC_SVNT > Orc_svnt_export.h`

   This file makes macros like `ORC_SVNT_Export` and friends available. They are usually controlled by `ORC_SVNT_BUILD_DLL`

4. `Orc_exec_export.h` - This file is generated using the following command:

   `generate_export_file.pl ORC_EXEC > Orc_exec_export.h`

   This file makes macros like `ORC_EXEC_Export` and friends available. They are usually controlled by `ORC_EXEC_BUILD_DLL`

5. `OrcE.idl` - Component Executor equivalent interface definitions. This file should be generated automatically by the CIDL compiler as illustrated in this file but we currently are still working on the implementation of the CIDL compiler. Therefore, you still need to create this file manually.

6. `OrcEI.idl` - Optional Component Executor implementation interface definitions. Often time, when you implement a non-trivial monolithic component implementation, you are required to define the monolithic local executor interface which often inherits from the component monolithic executor interface and all the provided interfaces. The actually executor implementation will inherit from this user defined interface instead of the default executor mapping defined in `OrcE.idl`. You will need to do the same when you wish to support non-vanilla component interface, such as `Components::SessionComponent`, and/or `Components::SessionSynchronization`.

   Ideally, it would be perfect if we can auto-generate this optional IDL file using CIDL compiler. However, I'm not sure the plan CIDL language contains enough information that's required to generate this file.

7. `Orc_exec.*` - These are files containing the actually component implementation that you have to write manually. It, however, depends on the equivalent executor IDL definition (that will be) generated by the CIDL files.

8. `Orb_svnt.*` - These are files containing the servant glue code that bridge a container to the component executor that you implement. Like the component executor mapping IDL file, these files should be generated by the CIDL compiler but are currently generated manually.

9. `Orc.csd` - Component Softpkg Descriptor. We need some kind of tool to generate this file automatically. It is currently being generated manually, however.

10. `Orc.ssd` - Servant Softpkg Descriptor. This is a CIAO extension descriptor file which uses the same softpkg DTD as described in CCM spec. CIAO requires this file because CIAO separates the executors into a completely separate DLL. Like `Orc.csd`, this file should be generated automatically through some tool, but it is currently manually crafted.

11. `Orc.ccd` - CORBA Component Descriptor. This file is currently being generated manually thou a template should really be generated by CIAO's CIDL compiler.

12. `Orc.mpc` - Makefile Project Creator definition file. There is a perl script to generate a minimal MPC definition at `$(CIAO_ROOT)/bin/generate_component_mpc.pl` so people can use it to implement the simplest component implementation outlined in this file.

Last modified: Fri Mar 21 16:06:48 Central Standard Time 2003