UML Profiles

What are UML Profiles?

UML Profiles provide a means of extending UML, which enables you to build UML models in particular domains. They are based on additional stereotypes and Tagged Values that are applied to elements, attributes, methods, connectors, connector ends and so on. A Profile is a collection of such extensions that together describe some particular modeling problem and facilitate modeling constructs in that domain. For example, the UML Profile for XML describes a set of extensions to basic UML model elements to enable accurate modeling of XSD Schemas (see Modeling XML Applications with UML, David Carlson, p. 310).

Enterprise Architect has a generic UML Profile mechanism for loading and working with different Profiles. UML Profiles for Enterprise Architect are specified in XML files, with a specific format; see the examples in this section. You can import these XML files into Enterprise Architect as part of an MDG Technology or through the Resources window. Once imported, you can drag and drop Profile elements onto the current diagram. Enterprise Architect attaches the stereotype, Tagged Values and default values, notes and even metafile if one is specified, to the new element. You can also drag and drop attributes and operations onto existing Classes and have them immediately added with the specified stereotype and values.

The imported Profile also automatically generates a page of elements and relationships in the Toolbox.

Note:

To control the appearance of elements, you can also set a default element template. For more information, see the Set Element Templates Package topic.

Profiles in the Resources Window

The Resources window contains a tree structure with entries for items such as MDG Technologies, Documents, Stylesheets, Matrix profiles and UML Profiles. The UML Profiles node initially contains no entries; to be able to use Profiles you must import them into Enterprise Architect from supplied XML files.

UMLProfiles

Items in the Profile represent stereotypes. These can be applied to UML elements in the following ways:

  • Stereotypes that apply to elements such as Classes and interfaces can be dragged directly from the Resources window to the current diagram, automatically creating a stereotyped element. Alternatively, they can be dragged onto existing elements, automatically applying them to the element.
  • Stereotypes that apply to attributes can be drag-and-dropped onto a host element (such as a Class); a stereotyped attribute is automatically added to the element's feature list.
  • Stereotypes that apply to operations are like those that apply to attributes; drag-and-drop onto a host element to add the stereotyped operation.
  • Stereotypes that apply to connectors such as associations, generalizations, messages and dependencies are added by selecting them in the Project Browser, then clicking on the start element in a diagram and dragging to the end element (in the same manner as adding normal connectors). A stereotyped connector is added.
  • Stereotypes that apply to association ends can be added by dragging the connector end element over the end of an Association in the diagram.

To get you started, some Profiles are supplied on the Sparx Systems website at www.sparxsystems.com/uml_profiles.htm. You can download these and import them into Enterprise Architect. Over time Sparx Systems intend to expand the range of Profiles, the content of each Profile and the degree of customization possible in each Profile.

You can also create your own Profiles to describe modeling scenarios specific to your development environment. For more information see the MDG Technology SDK topic.