UMLClassDiagramTutorial
UMLClassDiagramTutorial
The UML Class diagram is a graphical notation used to construct and visualize object oriented
systems.
What is a class?
A class in an object oriented system provides a crisp abstraction of a well defined set of
responsibilities.
Page 1 of 8
Visibility and Access for attributes and operations of a class
The +, - and # symbols before an attribute and operation name in a class denote the visibility of
the attribute and operation.
+ denotes public attributes or operations
- denotes private attributes or operations
# denotes protected attributes or operations
Access for each of these visibility types is shown below for members of different classes.
Access public private protect
(+) (-) ed (#)
Page 2 of 8
Operation (Method) Parameter Directionality
Each parameter in an operation (method) may be denoted as in, out or inout which specifies its
direction with respect to the caller. This directionality is shown before the parameter name.
Page 3 of 8
Relationships between classes
A relationship can be one of the following types: (Refer to the figure on the right for the
graphical representation of relationships)
Relationship Type Graphical Representation Inheritance (or
Generalization):
∙ Represents an “is-a” relationship.
Page 4 of 8
∙ Composition: A special type of
aggregation where parts are
destroyed when the whole is
destroyed.
o Objects of Class2 live and
die with Class1.
o Class2 cannot stand by
itself.
∙ Dependency:
o Exists between two classes if
changes to the definition of
one may cause changes to
the other (but not the other
way around).
o Class1 depends on Class2
Page 5 of 8