Creating and managing references in a Java profile implementation
Creating a reference
In a Java profile implementation, references are “proxy” metaclasses that refer to the metaclasses belonging to the reference metamodel or that refer to the stereotypes defined in the implemented profile.
References can be created by clicking
on the
icon from a Java profile
implementation.
Steps:
1. In the explorer, click on the Java profile implementation for which you want to create a metaclass reference.
2.
Click on the
icon. The “Reference” dialog box then
appears.
3. Select the metaclass you wish to reference. You can either select a metaclass directly in the metamodel tree or simply type the name of the metaclass in the field. If you choose to enter the metaclass name, you will see that even if you only enter the first few letters of the name, MDA Modeler will select the first available metaclass corresponding to this entry (for example, if you enter “pack”, the “Package” metaclass is automatically selected in the metamodel tree). The field is not case sensitive.
4. Click on “OK” to confirm. The new reference is then created and appears in the explorer.
After confirmation of the information entered, the following elements are created:
o a class stereotyped “reference” with the name of the selected metaclass as its name
o a static diagram named “Detailed view of Xxxx”, providing a detailed view of the referenced metaclass
Creating a reference using the drag and drop feature
The drag and drop feature can also be used to create a reference in a Java profile implementation (Figure 103).

Figure 103. Using the drag and drop feature to create a metaclass reference
Steps:
1.
After opening the “Reference”
dialog box (by clicking on the
icon), expand the referenced metamodel in the
explorer and select the metaclass you wish to reference.
2. Drag this metaclass from the explorer into the field of the “Reference” dialog box.
After this operation, the metaclass, if it exists, is automatically selected in the metamodel tree.
If the dragged and dropped metaclass is not contained in the metamodel, the following error message is displayed in the Objecteering console:
Error:
the “MyArtifact” metaclass is not in this metamodel.
Note: Metaclasses do not have to be dragged and dropped from the referenced metamodel. Any class with a name matching a metaclass contained in the metamodel tree can be used. For example, another metaclass reference from another profile can be dragged and dropped in the dialog box.
The “Reference” dialog box

Figure 104. The “Reference” dialog box
Key:
·
: This field
indicates the metaclass which has been selected as the reference.
· “Detailed documentation”: This button is used to open the detailed documentation for the selected metaclass, if it exists.
· “OK”: This button is used to confirm the creation of a reference for the selected metaclass. If the selected metaclass cannot be used as a metaclass reference, the “OK” button is grayed out. (Reference creation can also be confirmed by double-clicking on the selected metaclass in the metamodel tree or by selecting the metaclass and pressing “Return”).
· “Cancel”: This button is used to close the dialog box without creating the metaclass reference.
Detailed documentation
To consult detailed documentation on the metaclass selected as the reference, simply click on the “Detailed documentation” button.
If no metaclass has been selected, or if the selected metaclass has no associated documentation, the “Detailed documentation” button is grayed out.

Figure 105. Detailed documentation on the "ModelElement" class
Updating diagrams
If the “Create/update MDA diagrams automatically” MDAC option is activated and if you use the MDA icons to create MDA element, all diagrams concerning the reference are automatically created or updated.
Otherwise, the
button lets you force the creation or update
of the MDA diagrams.
Toolbar
The icons appearing in the “MDA” tab of the auxiliary window can be used to run the following commands:
|
Icon |
Description |
|
|
This icon is used to open this page. |
|
|
This icon is used to create/update diagrams, even if the “Create/update MDA diagrams automatically” option is desactivated. |
|
|
This icon is used to check that the metaclass reference has been correctly modeled. |