Jump to: navigation, search

Difference between revisions of "MDT-UML2Tools How To Use UML Profiles"

m
m
Line 9: Line 9:
 
==Create Profile==
 
==Create Profile==
 
=== Create Profile Definition Diagram ===
 
=== Create Profile Definition Diagram ===
First, create Profile Definition Diagram using wizard 'Profile Definition Diagram' from 'UML 2.1 Diagrams' located in File > New > Other > ... menu item.
+
First, create Profile Definition Diagram using wizard 'Profile Definition Diagram' from 'UML 2.1 Diagrams' located in File > New > Other > ... menu item.<br>
Profile is a root element of the created diagram.
+
Profile is a root element of the created diagram.<br>
 
Key elements of Profile Definition diagram are:
 
Key elements of Profile Definition diagram are:
 
* Profile
 
* Profile
Line 19: Line 19:
  
 
=== Define Profile ===  
 
=== Define Profile ===  
When profile is completely finished, it's time to define it. This is obligatory step in our workflow, because it saves defined profile as a static Ecore structure in UML model, it allows subsequent use of profile content. In order to define a profile in UML2 Tools call action "Profile > Define" from the context menu of the profile diagram:
+
When profile is completely finished, it's time to define it. This is obligatory step in our workflow, because it saves defined profile as a static Ecore structure in UML model, it allows subsequent use of profile content. <br>
 +
In order to define a profile in UML2 Tools call action "Profile > Define" from the context menu of the profile diagram:
  
 
=== Register Profile===
 
=== Register Profile===
Adding profile to the registry simplifies profile application later. The step can be omitted.  
+
Adding profile to the registry simplifies profile application later. The step can be omitted. <br>
Profiles are registered in plugin descriptor (plugin.xml file) using 'org.eclipse.uml2.uml.dynamic_package' extension point. The plugin should be deployed to the platform later.
+
Profiles are registered in plugin descriptor (plugin.xml file) using 'org.eclipse.uml2.uml.dynamic_package' extension point. The plugin should be deployed to the platform later.<br>
 
For example, UML Standard profile is registered this way:
 
For example, UML Standard profile is registered this way:
 
<source lang="xml">
 
<source lang="xml">
Line 33: Line 34:
 
==Use Profile==
 
==Use Profile==
 
=== Apply Profile ===
 
=== Apply Profile ===
In order to allow to apply the stereotypes defined in the profile to elements in the model, profile should be applied.  
+
In order to allow to apply the stereotypes defined in the profile to elements in the model, profile should be applied. <br>
 
To Apply profile call 'Apply Profile> [Profile Name]' action from the context menu of the diagram:
 
To Apply profile call 'Apply Profile> [Profile Name]' action from the context menu of the diagram:
  
What profiles appears in the drop-down list in the 'Apply Profile' action? Only those profiles that had been registered(see [step 3]) or profiles from loaded resources. If want one particular profile to appear in the list, register it or load corresponding *.profile.uml resource.
+
What profiles appears in the drop-down list in the 'Apply Profile' action? Only those profiles that had been registered (see [[#Register Profile]]) or profiles from loaded resources. If want one particular profile to appear in the list, register it or load corresponding *.profile.uml resource.
  
  
 
=== Apply Stereotype ===
 
=== Apply Stereotype ===

Revision as of 12:39, 16 October 2008

Introduction

UML cannot cover needs of all possible domains. Standard UML metamodel has to be augmented in order to meet requirements of a particular domain. That's why Profile mechanism was created - a way to create a lightweight extension of Standard UML.

Summary

Here is the workflow of creating and using UML profile:

UsingProfile.gif

Create Profile

Create Profile Definition Diagram

First, create Profile Definition Diagram using wizard 'Profile Definition Diagram' from 'UML 2.1 Diagrams' located in File > New > Other > ... menu item.
Profile is a root element of the created diagram.
Key elements of Profile Definition diagram are:

  • Profile
  • Stereotype
  • Metaclass
  • Extension link

18.10 Defining a simple EJB profile.gif

Define Profile

When profile is completely finished, it's time to define it. This is obligatory step in our workflow, because it saves defined profile as a static Ecore structure in UML model, it allows subsequent use of profile content.
In order to define a profile in UML2 Tools call action "Profile > Define" from the context menu of the profile diagram:

Register Profile

Adding profile to the registry simplifies profile application later. The step can be omitted.
Profiles are registered in plugin descriptor (plugin.xml file) using 'org.eclipse.uml2.uml.dynamic_package' extension point. The plugin should be deployed to the platform later.
For example, UML Standard profile is registered this way:

  <extension
     point="org.eclipse.uml2.uml.dynamic_package">
    <profile uri="http://www.eclipse.org/uml2/schemas/Ecore/5" location="pathmap://UML_PROFILES/Ecore.profile.uml#_0"/>
  </extension>

Use Profile

Apply Profile

In order to allow to apply the stereotypes defined in the profile to elements in the model, profile should be applied.
To Apply profile call 'Apply Profile> [Profile Name]' action from the context menu of the diagram:

What profiles appears in the drop-down list in the 'Apply Profile' action? Only those profiles that had been registered (see #Register Profile) or profiles from loaded resources. If want one particular profile to appear in the list, register it or load corresponding *.profile.uml resource.


Apply Stereotype