Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Use a class diagram to make a general model of the structure of an application that specifies the system's classes, its attributes and methods, and the relationships between objects. 

Note: Creating and editing UML diagrams on Visio for the web requires a Visio Plan 1 or Visio Plan 2 license, which is purchased separately from Microsoft 365. For more information, contact your Microsoft 365 admin. If your admin has turned on "self-service purchasing," you can buy a license for Visio yourself. For more details, see Self-service purchase FAQ.

Following are the shapes on the UML Class stencil.

Shape

Description

Class shape.

Describes a set of objects with similar structure, behavior, and relationships. The name of a class must be unique within its package. 

The class shape starts as a rectangle with three rows. The name of the class is in the top row. The other two rows are for methods or operations that the class may use.

Member shape

Describes an attribute or operation.

Separator shape

Used in a class shape to separate operations from attributes

Interface shape

Specifies the externally visible operations of a class, component, package, or other element without specifying internal structure.

Enumeration shape.

Describes a data type consisting of a set of named values. 

Package (expanded) shape.

Represents the basic organizing element of a UML model. It provides a namespace for the grouped elements. Each element belongs to only one package, and one package can be nested in another. 

Collapsed shape.

Represents a package in a process.

Note shape.

Used as a diagram comment that has no semantic influence on the model elements.

Inheritance shape.

Indicates that the source type inherits from the target type.

Interface Realization shape.

Indicates that the source type realizes the target interface. 

Association shape.

Represents a general relationship between instances of the classes.

Directed Association shape.

Represents a relationship that flows in only one direction between instances of the classes.

Aggregation shape.

Indicates that the object at the end with the diamond shape contains references to the object at the other end. If it contains that object exclusively, use a Composition shape instead. 

Dependency shape.

Indicates that the source type depends on the target type.

Composition shape.

Indicates that the source type has parts of the target type.

See Also

Create a UML class diagram

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×