UML Class Diagram
Start with UML Class Diagrams
Learn how to design UML class diagrams in seconds with GenMyModel, a UML tool to draw UML class diagrams.
- UML Class diagram introduction
- UML Class diagram examples to get started quickly
- No install, web-based application
- Export images and UML and generate Java, SQL
How to draw Class Diagram?
Read on the introduction and the overview of the main objetcs found in a UML class diagram. Then, copy an example and get started with your first UML class diagram!
The class diagram in the Unified Modeling Language (UML) is a type of static structure diagram that describes the structure of a system / application. Practically, the UML class diagram is used for visualizing, describing and documenting various aspects of an application but also for constructing executable code of the software application. It contains the system's classes, attributes, operations and the relationships among the classes. The UML class diagram is also known as a structural diagram. It's the most common starting point for software architects and developers when designing a system.
In this section, we breifly present the main concepts of a UML class diagram. The visual examples are designed with GenMyModel and its standard notations.
Generally in a UML class diagram, classes are the most represented elements. The classes are usually grouped together in a class diagram which helps determine the static relations between those objects.
Classes are represented with boxes containing three parts:
- The top part contains the name of the class.
- The middle part contains the attributes of the class.
- The bottom part contains the methods the class can execute.
Class members are attributes and operations (also called methods).
Visibility is set on attributes and operations. It can be:
- Public: the element is visible to all elements that can access the contents of the namespace that owns it
- Private: the element is only visible inside the namespace that owns it.
- Protected: the element is visible to elements that have a generalization relationship to the namespace that owns it
- Package: the element is owned by a namespace that is not a package, and is visible to elements that are in the same package as its owning namespace
A relationship is a logical connection found on UML classes.
An association represents a family of links. An association can link any number of classes and it can be named, and the ends of an association can be adorned with role names, ownership indicators, multiplicity, visibility, and other properties. Associations represent the static relationship shared among the objects of two classes. Learn more here about UML associations.
The generalization and realization are the common class-level relationships in UML class diagrams. Use and import are specialized from Dependency.
You can have a better overview of the example used above: UML class diagram example
Class Diagrams with GenMyModel
Easy Class Diagramming
GenMyModel is a web-based modeling tool providing a UML editor with powerful features for creating UML class diagrams, directly in the web browser. GenMyModel helps you create UML class diagrams right away, there's no install, no setup and no learning curve to get started.
At anytime, GenMyModel assists you design a valid UML class diagram by highlighting the UML elements that match an UML-compliant architecture. For example, it highlights in green the elements you are allowed to extend or generalize. It saves time when creating UML elements such as attribute's type, inheritance, realization (interface) or dependency.