UML Class Diagram
UML Class Diagram
A UML class diagram is a static diagram that shows classes and their relationships in the system. It is displayed as a rectangle with three components. A class is like a blueprint that defines the object.
Class Symbol
Class symbols in UML Class diagrams consist of three components separated by lines in a rectangle.
- Class name
- Attributes or Variables
- Operations or Methods
Class name identified the class in the system.
Attributes define the state of the class. Methods show the behavior of the class.
Interface Symbol
Interface symbol is same like Class symbol with <<interface>>Â string added to the top of the symbol. An interface is a contract between the class and to the public world. An interface contains only the method signatures without implementations. So, if the class implements an Interface all the methods should appear in the class.
Association
Association is represented as a solid line connecting the classifier / (s).
Generalization
Composition
Aggregation
Sample Class Diagram
A sample UML Class diagram that shows multi-level inheritance.