Standard stereotypes for UML models

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Standard stereotypes for UML models.

You can add stereotypes to UML model elements to provide additional information for the reader, or for machine processing. Stereotypes are defined in profiles and each profile provides set of stereotypes. Several profiles are provided with Visual Studio. You can also define your own profiles that can contain your own stereotypes. For more information, see Define a profile to extend UML.

To see which versions of Visual Studio support this feature, see Version support for architecture and modeling tools.

The following profiles are available in a supported edition of Visual Studio as soon as you have installed it.

ProfilePurpose
UML Standard Profile L2A standard set of stereotypes that can be used to add extra information about an element or a relationship.
UML Standard Profile L3A standard set of stereotypes that can be used to add extra information about an element or a relationship.
C# ProfileIf you intend a class or other element in a UML model to represent program code, you can indicate this by applying one of the stereotypes from the C# profile.

These stereotypes also add properties to the model elements.

When you create a new UML model, the UML Standard Profiles L2 and L3 are linked to the model, unless you remove the links.

To use the stereotypes in any of these profiles, you must first link the profile to a package or a model that contains the elements you want to apply them to.

To link a profile to a model or a package

  1. Open UML Model Explorer. On the Architecture menu, point to Windows, and then click UML Model Explorer.

  2. Locate either a package or a model that contains all the elements to which you will want to apply the stereotypes in the profile.

  3. Right-click the package or the model and then click Properties.

  4. In the Properties window, set the Profiles property to the profiles that you want.

To remove the link between a profile and a model or package

  1. In UML Model Explorer, right-click the model or package and then click Properties.

  2. In the Properties window, set the Profiles property to empty.

    System_CAPS_ICON_note.jpg Note

    You can unlink a profile only if none of the elements in the model or package use that profile's stereotypes.

To apply a stereotype to a model element

  1. Right-click the model element either on a diagram or in UML Model Explorer, and then click Properties.

  2. Click the Stereotypes property and select the stereotypes you want to apply.

    The selected stereotypes appear within «chevrons» in the model element, for most kinds of element.

    System_CAPS_ICON_note.jpg Note

    If you cannot see the Stereotypes property, or if the stereotype you want does not appear, verify that the model element is inside a package or a model to which the appropriate profile has been linked.

  3. Some stereotypes allow you to set the values of additional properties for the model element. To see these properties, expand the Stereotypes property.

UML Standard Profile L2

The following stereotypes can be used to specialize the meaning of UML model elements, unless the link to the profile has been removed from the model.

The exact meaning of these stereotypes is determined by your own local conventions, and by any tools that you might use to process the model.

StereotypeApplies toMeaning
auxiliaryClassA class that supports another class, typically by implementing additional logic. The other class may have the «focus» stereotype.
callDependencyThe client class calls the operations of the supplier.
createDependencyThe client class creates instances of the supplier.
createMessageThe sender creates the receiver.
createOperationThis operation is a constructor.
deriveDependencyThe client element is computed completely or partly from the supplier.
destroyOperationThe operation destroys its instance.
documentArtifactA «file» that is not a source or an executable.
entityComponentThe component represents a business concept.
executableArtifactAn executable «file».
fileArtifactA physical file.
focusClassA class defining the core business logic, that is supported by several «auxiliary» classes.
frameworkPackageThis package defines a reusable design pattern.
implementComponentThe implementation of a «specification».
implementationClassClassThe class describes an implementation, and each runtime instance has one fixed implementation class. Contrast with «type».
instantiateDependencyThe client creates instances of the supplier.
libraryArtifactA library «file».
metaclassClassInstances of this class are also classes.
modelLibraryPackageContains model elements intended to be reused by importing packages. Typically defined as part of a profile, and imported automatically by application of the profile.
processComponentA transaction-based component, or one that carries a thread.
realizationClass, Interface, ComponentDescribes an implementation.
refineDependencyThe client class, component, or package provides more information about the specification or design than the supplier.
responsibilityDependencyThe Comment at the supplier end of the Dependency defines the responsibilities of the client class or component.
scriptArtifactAn interpretable «file».
sendDependencyThe source Operation sends the target Signal.
serviceComponentA stateless component.
sourceArtifactA compilable «file».
specificationClass, Interface, ComponentDefines the behavior of a component or object without defining how it works internally.
subsystemComponentA part of a large system. A subsystem on a use case diagram is a component with the subsystem stereotype.
traceDependencyThe client element is part of the design that realizes the supplier. The two ends of this dependency are typically in different models. One of these models is a realization of the other.
typeClassSpecifies the behavior of an object without stating how it is implemented. An object is a member of a type if it conforms to the specification.
utilityClassA collection of static functions. The class has no instances.

UML Standard Profile L3

The following stereotypes can be used to specialize the meaning of UML model elements, unless the profile has been unlinked from the model.

The exact meaning of these stereotypes is determined by your own local conventions, and by any tools that you might use to process the model.

StereotypeApplies toDescription
buildComponentComponentA collection of elements used to define a build.
metaModelModelDefines a modeling language such as a variant of UML, or a domain specific language.
systemModelModelA model that is a collection of models that apply to the same system, for example, a specification, a realization, and trace relationships between them.

The stereotypes defined in this profile let you indicate that a model element is intended for translation to program code. Each stereotype defines additional properties that you can set on the model element.

To make these stereotypes available, link a model or package to the C# Profile. You can then apply the stereotypes to model elements in that model or package.

The available stereotypes, the elements to which they apply, and the additional properties that they make available are summarized in the following table.

StereotypeApplies toProperties
C# ClassUML Class

Component
Clr Attributes

 Is Partial

 Is Sealed

 Is Static

 Is Unsafe

 Package visibility
C# structUML Class

Component
Clr Attributes

 Is Partial

 Is Unsafe

 Package visibility
C# global membersUML Class

Component
Clr Attributes
C# InterfaceUML InterfaceClr Attributes

 Is Partial

 Package visibility
C# enumUML EnumerationClrAttributes

 Base Type
C# namespaceUML PackageClr Attributes

 Base Name

 Using namespaces

Add stereotypes to UML model elements
Customize your model with profiles and stereotypes
Define a profile to extend UML

Show: