Generator meta-components are one of the building blocks that are provided by the OBS Framework. They are introduced to automate the tailoring process whereby the assets provided by the framework are modified to match the needs of a target application (see the framework development process). More specifically, two types of generator meta-components can be identified serving two purposes:
- Instantiators that generate application-specific implementations for the abstract interfaces provided by the framework
- Configurers that automate the configuration of clusters of related components
In the OBS Framework, generator meta-components are implemented as XSL programs that process a specification written in XML and generate either code for the application-specific component or the configuration code for the cluster of components. Their mode of operation is illustrated in the figure:
Instantiators
Generator meta-components that generate application-specific implementations for the abstract interfaces provided by the framework are called instantiators. Their mode of operation is illustrated in the next figure:
The code generation process for an application-specific component is illustrated in the
next figure. The code generation is performed by a set of XSL programs that taken
together implement the generator meta-component. The aim of the generation process is to
construct a complete C++ class that implements the application-specific component. This
consists as a minimum of one header file and one body file but may also include an
#include
file that defines variables and constants that are exported by the
generated class. Additionally, in some cases, a test case class is also generated that
can be added to the framework test
suite to test the generated class.
Configurers
In order to appreciate the rol of the configurer meta-components it is useful to divide the life of an application to be instantiated from the OBS Framework into two phases. In the initialization phase, all the components required by the target application are instantiated and configured. In the operational phase, the target application performs the function that users expects from it and that justify its existence. The configurer meta-components are concerned with the component configuration process in the former of these two phases. The component configuration process consists in executing a set of operations upon a given component to ready it for the operational phase. Typical configuration operations are the setting of property values and the composition of plug-in components.
The configurer generator meta-components are responsible for configuring clusters of related components. They are implemented as XSL rules that are called by a master XSL program that is responsible for generating the initialization code of an application. The configurer meta-components contribute fragments of this initialization code in that each configurer meta-component covers the configuration of a set of logically related components. The OBS Framework currently provides a set of configurer meta-components that are described in greater detail in a dedicated page.It should be noted that there is, in principle, one way to dispense with configurer meta-components. If a component meta-model were introduced to define the kind of operations that can be performed to instantiate components, to configure them, and to link them together (an example of such a meta-model is the JavaBeans standard), then it would be possible to have one generic meta-component that processes an application model and automatically generates all its initialization code. The adoption OBS Framework does not at present adopt this approach in full. This means that capturing the configuration process of tis components requires many distinct configurer meta-components. Future versions of the framework may be re-designed to comply with it and thus to avoid the need for configurer meta-components.