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  | 
            
|---|---|
| 
                 
                     | 
              
                 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.  | 
            
| 
                 
                     | 
              
                 Describes an attribute or operation.  | 
            
| 
                 
                     | 
              
                 Used in a class shape to separate operations from attributes.  | 
            
| 
                 
                     | 
              
                 Specifies the externally visible operations of a class, component, package, or other element without specifying internal structure.  | 
            
| 
                 
                     | 
              
                 Describes a data type consisting of a set of named values.  | 
            
| 
                 
                     | 
              
                 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.  | 
            
| 
                 
                     | 
              
                 Represents a package in a process.  | 
            
| 
                 
                     | 
              
                 Used as a diagram comment that has no semantic influence on the model elements.  | 
            
| 
                 
                     | 
              
                 Indicates that the source type inherits from the target type.  | 
            
| 
                 
                     | 
              
                 Indicates that the source type realizes the target interface.  | 
            
| 
                 
                     | 
              
                 Represents a general relationship between instances of the classes.  | 
            
| 
                 
                     | 
              
                 Represents a relationship that flows in only one direction between instances of the classes.  | 
            
| 
                 
                     | 
              
                 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.  | 
            
| 
                 | 
              
                 Indicates that the source type depends on the target type.  | 
            
| 
                 | 
              
                 Indicates that the source type has parts of the target type.  |