7.2. Framework Usage / Code Generation#

GMT frameworks are intended to be extensible by specializing a set of base classes. A set of tools provides the capability to generate the skeleton of a component implementation from the specification of its interface. The Figure below (Component Skeleton Generation) shows the relation between generated skeletons and the GMT modeling framework.

The skeleton generation tools are available for every layer of the modeling framework, i.e. they can generate the skeleton of a model element from the metamodel or generate the skeleton of a runtime component from the model specification.

../../_images/component-skeleton-generation.png

Fig. 7.1 Component Skeleton Generation. The GMT modeling framework is based in the OMG Meta Object Facility specification. The group on the left shows the main entities in the layered modeling architecture. A set of modular plugins allows one to generate skeletons and instances from layer to layer. The gen_skeleton function (1) allows the generation of the skeleton of a model element. The gen_instance function (2) allows the capability to generate the skeleton of an instance of a model element. Instances are created in the next model layer and they inherit the behavior of some of the framework base classes.#

The table below describes three common framework use cases and the functionality provided by the frameworks involved.

Table 7.3 Framework Typical Use Cases#

Use Case

Framework

Base Classes

Function

Create a new Controller

Core Framework

Base Component

Provides access to observatory services

Device Control Framework

BaseDeviceController

Provides usable control building blocks

I/O Framework

IOModule, Device

Provides access to the hardware

Create a new Pipeline

Core Framework

BaseComponent

Provides access to the observatory services

Data Processing Framework

Pipeline, Filter, Recipe

Defines a reference architecture for data processing pipelines

Persistence Framework

ObjectStore, FileStore

Provides persistence to files and data structures

Create a new Panel

Core Framework

BaseComponent

Provides access to Observatory Services

UI Framework

Panel, Widget

Provides reusable visualization components