UNO Components

This section will explain some very basic things about UNO components. You might skip it if you already know it. First I will explain what is a component and it's mains parts. Afterwards, I will explain what is needed to create a UNO component to help you to fully understand the different tools and their use during the tutorial.

Components anatomy

"A component is a system element offering a predefined service and able to communicate with other components" explains Wikipedia (Fr). In UNO case a component will generally be delivered as a package containing a library (share library in C++ or jar in Java). For UNO a component is made of two distinct parts: specifications and an implementation.

Specification

definition in a common language of what the component should do. For UNO, this language is called UNO-IDL and is more or less similar to Corba IDL. The documented part that will be provided as an API to use the component is the specification. Thus it should be complete and implementation independent.

Implementation

is the code that will realize what is described in the component specifications. This programming language can either be C++, Java, Python or some others. This is the internal part of the component and will not be accessible from another component.

In order UNO knows which implementation corresponds to which specification, the component will use registries. There are two of them: the first one describes all the component specifications (types.rdb) and the second translates the implementation into specifications ( services.rdb) and is generated from the implementation.

Components creation process

To help you better understand what should be done to get a component from it's specification and sources, you should have a look at the illustration 1. As shown by the diagram, the specifications are compiled and merged into one types.rdb registry. Class files are generated from that file to translate the specifications into a Java class definition file which is build with the implementation into class using the java compiler. All the classes are delivered as a jar file with a specific manifest as we will see further in this tutorial. This doesn't make a usable OpenOffice.org: the types.rdb and jar file will have to be zipped into a .uno.pkg file described with another manifest.

Java UNO compilation chain
Illustration 1: Java Uno compilation chain

As I will explain it later, the Eclipse plugin will hide some of these operations, however you will need to know how they work to fully understand the build process and what we will do in the next steps.