UML Class Diagrams: Reference
A UML class diagram describes the object and information structures used by your application, both internally and in communication with its users. It describes the information without reference to any particular implementation. Its classes and relationships can be implemented in many ways, such as database tables, XML nodes, or compositions of software objects.
This topic is about UML class diagrams. There is another kind of class diagram, the .NET class diagram, which is used to visualize program code. For more information, see Designing and Viewing Classes and Types.
To create a UML class diagram, on the Architecture menu, choose New UML or Layer Diagram. For more information about how to draw UML class diagrams, see UML Class Diagrams: Guidelines. For more information about how to create and draw modeling diagrams, see Edit UML models and diagrams.
To see which versions of Visual Studio support this feature, see Version support for architecture and modeling tools.
The table in this section describes the elements that you can see on a UML class diagram. For information about the properties of these elements, see the following topics:
A definition of objects that share given structural or behavioral characteristics. For more information, see Properties of types on UML class diagrams.
The general name for a class, interface, or enumeration. Components, use cases, and actors are also classifiers.
Collapse/ Expand control
If you cannot see the details of a classifier, click the expander at upper-left of the classifier. You might also have to click the [+] on each segment.
A typed value attached to each instance of a classifier.
To add an attribute, click the Attributes section and then press ENTER. Type the signature of the attribute. For more information, see Properties of attributes on UML class diagrams.
A method or function that can be performed by instances of a classifier. To add an operation, click the Operations section and then press ENTER. Type the signature of the operation. For more information, see Properties of operations on UML class diagrams.
A relationship between the members of two classifiers. For more information, see Properties of associations on UML class diagrams.
An association representing a shared ownership relationship. The Aggregation property of the owner role is set to Shared.
An Association representing a whole-part relationship. The Aggregation property of the owner role is set to Composite.
The name of an association. The name can be left empty.
The name of a role, that is, one end of an association. Can be used to refer to the associated object. In the previous illustration, for any Order O, O.ChosenMenu is its associated Menu.
Each role has its own properties, listed under the properties of the association.
Indicates how many of the objects at this end can be linked to each object at the other. In the example, each Order must be linked to exactly one Menu.
* means that there is no upper limit to the number of links that can be made.
The specific classifier inherits part of its definition from the general classifier. The general classifier is at the arrow end of the connector. Attributes, associations, and operations are inherited by the specific classifier.
Use the Inheritance tool to create a generalization between two classifiers.
A definition of part of the externally visible behavior of an object. For more information, see Properties of types on UML class diagrams.
A classifier that consists of a set of literal values.
A group of classifiers, associations, actions, lifelines, components and packages. A logical class diagram shows that the member classifiers and packages are contained within the package.
Names are scoped within packages so that Class1 within Package1 is distinct from Class1 outside that package. The name of the package appears as part of the Qualified Name properties of its contents.
You can set the Linked Package property of any UML diagram to refer to a package. All the elements that you create on that diagram will then become part of the package. They will appear under the package in UML Model Explorer.
A relationship between packages, indicating that one package includes all the definitions of another.
The definition or implementation of the dependent classifier might change if the classifier at the arrowhead end is changed.
The class implements the operations and attributes defined by the interface.
Use the Inheritance tool to create a realization between a class and an interface.
An alternative presentation of the same relationship. The label on the lollipop symbol identifies the interface.
To create this presentation, select an existing realization relationship. An action tag appears near the association. Click the action tag, and then click Show as Lollipop.