UML NotesPart 1
UML NotesPart 1
CLASS NOTES:
19/8/2024:
• Uses for UML:
o To communicate aspects of a system
o Used as a blueprint
o Used, for tools that create code from UML
20/8/2024:
Association types (a usage relationship):
Associational relationships:
• Actors: specifies a role played by a user or any other system that interacts with the
subject
o are external to the system; May or may not be human
o Identified in terms of the roles they play.
o e.g. Time; A system for devising staff work timetables;
• Actors don’t interact with each other, in a use case model.
• Primary actor accomplishes a goal via the use case.
o LHS
• Secondary actor provides a service to the use case.
o RHS
• System boundary: distinguishes the system from the rest of the world.
o Use Cases are inside the box; Actors are outside.
o
• Use cases are represented by ovals ^:
o Name of use case inside ellipse/oval
• Stereotype: when one use case is related to another
o <<includes>> <<uses>> <<extends>>
o <<extends>> is used for part of use case that will sometimes be used and
sometimes not. AKA its use is NOT guaranteed.
• Guidelines:
o Use-cases start with a verb
o EBP:
(Part 3 – Sequence diagrams):
28/8/2024 (Part 4 –Activity, State & Package Diagrams):
•
• State machines / state diagrams:
o Shows how an object changes due to external stress over lifetime
o Reactive
o Needs an external diagram
UML Packages:
•
EXTERNAL NOTES:
https://www.geeksforgeeks.org/unified-modeling-language-uml-class-diagrams/ d
Overview:
• Class: a blueprint or template for creating objects
• Class Diagram: visually represents the structure and relationships of classes within a
system i.e. used to construct and visualize object-oriented systems.
o Association: represents relations between instances, elements
▪ e.g. ~
• Classes are depicted as boxes, each containing three compartments for the class:
name, attributes, and methods. Lines connecting classes illustrate associations,
showing relationships such as one-to-one or one-to-many.
Association types:
• In (Input):
o An input parameter is a parameter passed from the calling object (client) to
the called object (server) during a method invocation. It is represented by an
arrow pointing towards the receiving class (the class that owns the method).
• Out (Output):
o An output parameter is a parameter passed from the called object (server)
back to the calling object (client) after the method execution. It is
represented by an arrow pointing away from the receiving class.
• InOut (Input and Output):
o An InOut parameter serves as both input and output. It carries information
from the calling object to the called object and vice versa. It is represented
by an arrow pointing towards and away from the receiving class.