Developing model components

 

Introduction

The development of a model component is the first phase in the model component life cycle, during which a model component is prepared by a developer for packaging.

 

Model component development includes the following operations:

·         the UML model must first be built (including any specific code generation annotations you wish to include)

·         the model component must then be created and defined.  This includes the creation of the future model component itself (name, description, version number), as well as the definition of its contents (model parts and external files) and its dependencies on other model components.

 

This section presents how to create and define a model component.

 

 

Preparing your environment

Before creating model components, the RAMComponent MDA component must first be deployed in your project, by running the "Tools/Deploy an MDAC" command and choosing the RAMComponent MDA component.

 

For more information on deploying MDA components, please see "Working with MDA components".

 

 

Creating a model component

The first step in the development of a model component is its creation inside a UML model.

 

To create a model component, follow the steps shown below.

 

Creating a model component

 

Steps:

1.      Select the root of your project.

2.      Click on the  "Create a model component" icon.  The "Model component properties" window then appears (as shown below).

 

 

Defining model component information

The next step is to define the model component you have just created.  This includes:

·         the definition of the name of the model component. 

·         the definition of the description of the model component

·         the definition of the version number of the model component. This version number must contain three figures separated by periods.

 

These three operations are illustrated in the screenshot below.

 

Defining a name, description and version number for a model component

 

Steps:

1.      In the "Name" field, enter a name for your model component.

2.      In the "Description" field, enter a description for your model component.

3.      In the "Version" fields, enter a version number for your model component.  The three parts of the version number correspond to the version number, the major release number and the minor release number.

 

Note:      If you want to confirm the information you have just entered, click on "OK".  The information you have entered is then saved and the window closed.  You can, however, choose to continue with the following operations, and only confirm after you have finished defining your model component.

 

 

Defining model parts to be included in a model component

Model elements to be included in a model component are referenced using manifestation links.  These elements will be available for use in projects where the model component is deployed.  Only high-level packages (packages located under the project root) can be referenced by a model component through a manifestation link.  However, all the elements they contain will also be packaged in the model component.

 

You can create manifestations to as many packages as you like.

 

To reference a package from a model component, proceed as shown in the screenshot below.

 

Referencing packages to be included in your model component

 

Steps:

1.      In the explorer, select the package you want your model component to reference.

2.      Drag and drop this package into the "Attached packages" field.  A manifestation link is automatically created between your model component and the selected package. 

 

Note:      If you want to confirm the information you have just entered, click on "OK".  The information you have entered is then saved and the window closed.  You can, however, choose to continue with the following operations, and only confirm after you have finished defining your model component.

 

 

Defining external files to be included in a model component

External files can also be included in a model component.  This is typically useful when you want your model component to install specific files such as libraries, jar files or resource files when it is deployed.

 

For example, let's imagine that you have reversed the Java JDK, in order to produce a reusable component.  This type of model component, when deployed, should allow Java application development including compilation, meaning that JDK jar files would then have to be deployed by the model component.

 

When defining external files to be included in a model component, the $(GenRoot) variable should be used.  This variable is the root directory for generation, and can be defined by each user at Objecteering Modeler parameter level, which means that the external files included in the model component will be deployed correctly in each user's own individual environment.

 

To include an external file in your model component, proceed as shown below.

 

Defining external files to be packaged in your model component

 

Steps:

1.      In the "Attached files" field, click on the  icon.  This opens a file select browser.

2.      Select the external file you want to package in your model component and click on the "OK" button to confirm.

 

 

Modeling dependencies between model components

If your model component is dependent on another model component, this fact must be modeled through a use link, which can be created in the "Model component properties" window, as shown below.

 

Note:      Use links can also be modeled using the the fast link editor.

 

Model component dependencies are so-called "strict" dependencies, meaning that a model component depends on a specific version of another model component, which must be deployed first in a project.  For more information, please see "Deploying model components".

 

Creating a dependency between two model components

 

Steps:

1.      In the explorer, select the model component on which your model component will depend.

2.      Drag and drop it into the "Dependencies to other model components" zone.  The dependency is immediately created between your model component and the other model component.

 

Once you are satisfied that you have carried out all these steps correctly, you can proceed with the packaging of your model component.