Roadmap of UML
Roadmap of UML
UML
1
UML Unified Modeling Language
Types UML
2
UML Unified Modeling Language
Structure Diagrams
1-Class Diagram
There are three major parts of a class To create a class diagram, the next step
diagram as shown in the image below: is building relationships. There are three
main types of relationships here:
1. Class Name
2. Class Attributes 1. Generalizations
3. Class Operations 2. Associations
3. Dependencies
—--------------------------------------------
Generalizations
Attributes
3
UML Unified Modeling Language
Associations Composition
1. class House {
2. private Room livingRoom;
3. // constructors, methods, etc.
4. }
5. class Room {
6. // room implementation
7. }
Inheritance
1. class Animal {
2. // animal implementation }
3. class Dog extends Animal {
4. // additional dog-specific properties and
behaviors
Association 5. }
4
UML Unified Modeling Language
—------------------------------------------
Association Cardinality
Unspecified navigability
Navigable in one direction
Navigable in both directions
Navigable in one direction (explicit)
Non-navigable
—-------------------------------------
ssociation Navigability with Class
The association ends can have various
Ownership
cardinalities:
● One
● Zero or one
● Zero to many
● One to many
● Many
● A specific number
● A specific range of numbers
5
UML Unified Modeling Language
Dependencies
1. class Organization {
2. // organization implementation
3. }
4. class Employee {
5. private Organiz organiz;
—--------------------------------------------------------
6. public Employee(Organiz organiz){
7. this.organiz=organiz;
8. }}
Class Diagram Example: GUI
● Public (+)
● Private (-)
● Protected (#)
—--------------------------------------------------------
● Package (~)
● Derived (/)
● Static (underlined)
6
UML Unified Modeling Language
2-Component Diagram
—-----------------------------------------------------
—-----------------------------------------------------
Port
Basic Concepts of Component
Diagram Ports are represented using a square along
the edge of the system or a component. A
1. A rectangle with the component's port is often used to help expose required
name and provided interfaces of a component.
2. A rectangle with the component icon
3. A rectangle with the stereotype text
and/or icon
—-----------------------------------------------------
—-----------------------------------------------------
Association: _______________
Interface
In the example below shows two type of ● An association specifies a semantic
component interfaces: relationship that can occur between
typed instances.
● It has at least two ends represented
by properties, each of which is
connected to the type of the end.
More than one end of the association
may have the same type.
7
UML Unified Modeling Language
Composition: Links:
—-----------------------------------------------------
Dependency
—-----------------------------------------------------
8
UML Unified Modeling Language
—-----------------------------------------------------
Required interfaces:
A straight line from the component box with
an attached half circle (also represented as
a dashed arrow with an open arrow). These
symbols represent the interfaces where a
component requires information in order to
perform its proper function.
—----------------------------------------------------- —-----------------------------------------------------
9
UML Unified Modeling Language
3-Deployment Diagram
Other Notations
When to Use Deployment Diagram
● Dependency
● Association relationships.
● What existing systems will the newly ● May also contain notes and
added system need to interact or constraints.
integrate with?
● How robust does system need to be
(e.g., redundant hardware in case of
a system failure)?
● What and who will connect to or
interact with system, and how will
they do it
● What middleware, including the
operating system and
communications approaches and
protocols, will system use?
● What hardware and software will
users directly interact with (PCs,
network computers, browsers, etc.)?
● How will you monitor the system
once deployed? —---------------------------------------------------
● How secure does the system needs
to be (needs a firewall, physically Steps for Modeling a Client/Server
secure hardware, etc.)?
System
—---------------------------------------------------
The example shows the topology of a
human resources system, which follows a
Nodes classical client/server architecture.
10
UML Unified Modeling Language
—--------------------------------------------------- —---------------------------------------------------
—---------------------------------------------------
11
UML Unified Modeling Language
4-Object Diagram
Object Diagram Example I -
Basic Object Diagram Symbols Company Structure
and Notations
: Object Names
—--------------------------------------------------- —---------------------------------------------------
—---------------------------------------------------
Links:
12
UML Unified Modeling Language
—---------------------------------------------------
5-Package Diagram
13
UML Unified Modeling Language
—---------------------------------
—---------------------------------
14
UML Unified Modeling Language
—---------------------------------
—---------------------------------
15
UML Unified Modeling Language
6-Profile Diagram
● Stereotypes
● Tagged Values
● Constraints
Stereotypes
Constraints
Stereotypes allow you to increase
vocabulary of UML. You can add, create
new model elements, derived from existing
For example: In development of a real time
ones but that have specific properties that
system it is necessary to adorn the model
are suitable to your problem domain.
with some necessary information such as
Stereotypes are used to introduce new
response time. A constraint defines a
building blocks that speak the language of
relationship between model elements that
your domain and look primitive. It allows
must be use {subset} or {xor}. Constraints
you to introduce new graphical symbols.
can be on attributes, derived attributes and
For example: When modeling a network
associations. It can be attached to one or
you might need to have symbols for
more model elements shown as a note as
<<router>>, <<switches>>, <<hub>> etc. A
well.
stereotype allows you to make these things
appear as primitive.
16
UML Unified Modeling Language
17
UML Unified Modeling Language
Example
18
UML Unified Modeling Language
Interface
Composite Structure diagram supports the
ball-and-socket notation for the provided
and required interfaces. Interfaces can be
shown or hidden in the diagram as needed.
Connector
A line that represents a relationship in a
model. When you model the internal
structure of a classifier, you can use a
connector to indicate a link between two or
more instances of a part or a port. The
connector defines the relationship between
the objects or instances that are bound to
roles in the same structured classifier and it
identifies the communication between those
roles. The product automatically specifies
the kind of connector to create.
19
UML Unified Modeling Language
—-----------------------------------
Generalization Relationship
—-----------------------------------
—-----------------------------------
Include Relationship
20
UML Unified Modeling Language
Association Link
21
UML Unified Modeling Language
Extends Generalization
● A generalization relationship is a
● Indicates that an “Invalid Password”
parent-child relationship between use
use case may include (subject to
cases.
specified in the extension) the
● The child use case is an enhancement
behavior specified by base use case of the parent use case.
“Login Account”. ● Generalization is shown as a directed
● Depict with a directed arrow having a arrow with a triangle arrowhead.
dotted line. The tip of arrowhead ● The child use case is connected at the
points to the base use case and the base of the arrow. The tip of the arrow
child use case is connected at the is connected to the parent use case.
base of the arrow. ●
● The stereotype “<<extends>>”
identifies as an extend relationship
Use Case Diagram Examples
Include
● When a use case is depicted as using
the functionality of another use case,
the relationship between the use
cases is named as include or uses
relationship.
● A use case includes the functionality
described in another use case as a
part of its business process flow.
● A uses relationship from base use
case to child use case indicates that Carpark system
an instance of the base use case will
include the behavior as specified in
the child use case.
● An include relationship is depicted with
a directed arrow having a dotted line.
The tip of arrowhead points to the
child use case and the parent use
case connected at the base of the
arrow.
● The stereotype “<<include>>”
identifies the relationship as an include
relationship.
22
UML Unified Modeling Language
—----------------------------------------------
—----------------------------------------------
Action
Activity Diagram - Learn by A task to be performed
Examples
—----------------------------------------------
Control Flow
Shows the sequence of execution
—----------------------------------------------
Object Flow
Show the flow of an object from one activity
(or action) to another activity (or action).
—----------------------------------------------
Initial Node
Portrays the beginning of a set of actions or
activities
23
UML Unified Modeling Language
—----------------------------------------------
—----------------------------------------------
Decision Node
Represent a test condition to ensure that
the control flow or object flow only goes
down one path
—----------------------------------------------
—----------------------------------------------
Fork Node
Split behavior into a set of parallel or
concurrent flows of activities (or actions)
24
UML Unified Modeling Language
—----------------------------------------------
—----------------------------------------------
25
UML Unified Modeling Language
26
UML Unified Modeling Language
27
UML Unified Modeling Language
Lifeline
Actor
28
UML Unified Modeling Language
Self Message
Recursive Message
29
UML Unified Modeling Language
Note
30
UML Unified Modeling Language
31
UML Unified Modeling Language
32
UML Unified Modeling Language
33
UML Unified Modeling Language
If you open this sequence diagram in Visual sequence numbers to determine the order
Paradigm you can automatically generate of messages between objects:
the communication diagram shown in figure
below:
34
UML Unified Modeling Language
Interaction Use
35
UML Unified Modeling Language
36
UML Unified Modeling Language
37
UML Unified Modeling Language
Multiple Compartments
Value Lifeline
It is possible to stack several life lines of A value lifeline shows the change of value
different objects in the same timing of an item over time. The X-axis displays
diagram. One life line above the other. elapsed time in whatever units are chosen,
Messages sent from one object to another the same as for the state lifeline. The value
can be depicted using simple arrows. The is shown between the pair of horizontal
start and the end points of each arrow lines which crosses over at each change in
indicate when each message was sent and value.
when it was received.
38
UML Unified Modeling Language
39