UNIT 1_UML Basic Notations
UNIT 1_UML Basic Notations
• Inheritance
Also known as generalization, this is a relationship where a
subclass inherits attributes, methods and other relationships
from a superclass.
• Association
Sometimes called simple association, this is a relationship
that indicates one class is related to another but not
necessarily dependent.
• Aggregation
A special type of association, aggregation is where one
class contains, or is composed of, other classes. A whole
and its parts.
These parts can exist independently of the larger class and
may be shared among multiple wholes.
The shape of this connection is a hollow diamond attached
to the "part" with a solid line going back to the "whole" or
class.
• Composition
On the flipside is composition, where a part cannot exist
without the whole, or superclass.
Expanding the example further and adding a couple more
classes; stadiums and snack bars. If the team’s stadium is
torn down, the snack bar can’t exist.
This is drawn with a solid line and filled in diamond at the
superclass, or stadium in this case.
• Dependency
This is a relationship where one class relies on another in
some way, often through method parameters, return types
or temporary associations.
Coaches and players are related in this way, where the
coach depends on the performance data or behavior of
players to make strategic decisions.
We’d show this with a dashed line and an open arrow.
Add multiplicity notation (if necessary)
• Multiplicity specifies how many instances of one class are
associated with instances of another class in an association.
• For example, the player and team association would have multiplicity
notation to indicate there are multiple players on a team.
• The way we show that on the structure diagram is as follows:
• 0..1 = zero to one
• 1 = exactly one
• 0..* = zero to many
• 1..* = one to many
• n..m = specific number range
• Example:
• https://www.visual-paradigm.com/guide/uml-unified-
modeling-language/uml-class-diagram-tutorial/
• Association(using relationship): The objects created and
destroyed independently and represented as one-to-one, one-
to-many, or many-to-many (also known as cardinality).
• Aggregation(HAS-A relationship): parent can exist without
child and a child can exist independently of the parent and
this involve a one-to-one, one-to-many, or many-to-many
relationship between the participating objects.
• composition(“death” relationship, PART-OF): parent
destroyed, child dies
• Inheritance : is-a relationship.