BreadcrumbHomeResourcesBlog How To Draw UML Class Diagrams April 25, 2024 How to Draw UML Class DiagramsDiagrams for Software EngineeringBack to topWhat Are UML Class Diagrams? Class diagrams in Unified Modeling Language (UML) are a type of application architecture diagram used for conceptual object-based modeling or data modeling that describe the relationships and interactions between a system's components.Class diagrams, like many other types of UML diagrams, help you simplify complex structures so you can easily communicate them to stakeholders throughout the business. They can also be helpful for project planning.With this tutorial, we’ll make it easy for you to create UML class diagrams to describe any system, no matter how complex. Start your evaluation of Gliffy to follow along.Try Gliffy FreeTable of ContentsWhat Are UML Class Diagrams? Class Diagram Elements & Notation2 Ways to Create Class DiagramsDraw UML Class Diagrams Directly in ConfluenceTable of Contents1 - What Are UML Class Diagrams? 2 - Class Diagram Elements & Notation3 - 2 Ways to Create Class Diagrams4 - Draw UML Class Diagrams Directly in ConfluenceBack to topClass Diagram Elements & NotationClass diagrams can include a wide variety of symbols and elements depending on the complexity of the system — but the two essential elements of any class diagram are classes and interactions.ClassesClasses, the central objects in a system, are the building blocks of UML class diagrams. They are shown in a diagram as rectangles with varying levels of detail depending on the object being visualized.Upper Section: The top section of a UML class names the class and is always required. Middle Section: The middle section of a UML class describes the attributes of the class and may not be required for every class.Bottom Section: The bottom section of a UML class lists its operations, which define its behavior and interactions. This may not also be required for every class.Attributes within classes also have different access levels that define their visibility. They are represented by different symbols for public (+), private (-), protected (#), and package (~) elements.Interactions There are many types of interactions that you can visualize with your class diagram, and each type is represented by a different type of line or arrow between classes. Two of the most common interactions in a UML class diagram are association and inheritance.AssociationsAssociations are lines between classes that indicate some kind of connection between them. This could mean that both classes are aware of each other or only one is aware of the other — the arrowhead (or lack thereof) on either side of the line indicates the level of interaction.InheritanceInheritance refers to a relationship between a parent class and a subclass that serves as an extension of it. This is represented by an arrow with an open head pointing toward the parent class from the subclass. Back to top2 Ways to Create Class DiagramsMethod 1: Create Class Diagrams From CodeWant to create a class diagram to document your system, but short on time? When you diagram in Confluence with Gliffy, you can generate class diagrams from code with Mermaid markdown, so you can enjoy the benefits of visual documentation without spending time you don’t have on making every shape and line look just right.1. Open a new Gliffy diagram and click the lightbulb icon.Type /gliffy onto any Confluence page to open the Gliffy editor, then click the lightbulb icon on the far left side of your screen. 2. Select “Mermaid” in the panel that opens. This will take you to the Mermaid editor, where you can construct your diagram. 3. Enter your code, then click “Build Diagram.”Inside the Mermaid editor, you can type (or copy and paste) the text that represents the way you want your diagram to look. When you’re done, click “Build diagram” and your automatically-generated diagram will be inserted onto the canvas. It’s easy to edit your Mermaid diagram after creating it — just double click on it and you will re-enter the editing modal and can change the text as necessary.Tip: For more help with Mermaid in Gliffy, check out our Mermaid diagramming tutorial >>Method 2: Create Class Diagrams With Shape LibrariesIf you aren’t familiar with Mermaid and would prefer to create your diagram by dragging and dropping shapes onto the canvas, good news: Gliffy makes it easy and intuitive to diagram that way as well.Prefer to learn from a video? Check out our UML Class Diagram tutorial >>1. Create a blank diagram or start from a template. Type /gliffy on any Confluence page to create a new diagram. In the panel that opens, select “Software Design: UML & ERD” to start from scratch or find a template by scrolling down and selecting the “Software Design & UML” category (pictured below). 2. Drag and drop classes onto the canvas.If you don’t see the shapes you need, click “More Shapes” at the bottom left of your screen and make sure you have all the UML libraries selected. Once you have access to the proper libraries, you can find specific shapes faster by searching for them in the search bar at the top of the shapes panel. 3. Use connectors to bring it all together.Gliffy offers the ability to use many different arrow styles to illustrate the relationships between your diagram classes. When you select a line, click the line icon to edit its properties. Back to topDraw UML Class Diagrams Directly in ConfluenceCreating technical documentation for object-based programming is easier with Gliffy, because it allows you to visually document objects and their interactions directly in Confluence.Whether you’re creating your class diagram with Mermaid markdown or by drawing your own diagram with our built-in UML shape libraries, it’s free to get started today.TRY GLIFFY FOR CONFLUENCEBack to top