In this UML training, you will get:
Introduction to OOA and UML
Stated vs Un-stated
Software Analysis and Design
Modeling
UML
Why UML
Overview
Types
Use Case Diagram
For more information, visit: https://www.mindsmapped.com/courses/business-analysis/unified-modeling-language-uml-the-complete-guide/
3. Page 3Classification: Restricted
• Used for describing structure and behavior in the use cases
• Provide a conceptual model of the system in terms of entities and their
relationships
• Used for requirement capture, end-user interaction
• Detailed class diagrams are used for developers
Class diagram
5. Page 5Classification: Restricted
Class representation
• Each class is represented by a rectangle subdivided into three
compartments
• Name
• Attributes
• Operations
• Modifiers are used to indicate visibility of attributes and operations.
• ‘+’ is used to denote Public visibility (everyone)
• ‘#’ is used to denote Protected visibility (friends and derived)
• ‘-’ is used to denote Private visibility (no one)
• By default, attributes are hidden and operations are visible.
6. Page 6Classification: Restricted
An example of Class
Account_Name
- Customer_Name
- Balance
+addFunds( )
+withDraw( )
+transfer( )
Name
Attributes
Operations
7. Page 7Classification: Restricted
• Super Class
• Parent Class
• Generalized Class
• Specialized Class
• Sub Class
• Child Class
Types of Classes
8. Page 8Classification: Restricted
Animal
Amphibian Mammal Reptile
Horse
Example
Child Class
of Animal
Child Class
of Animal
Child Class
of Mammal
Super Class
of horse
Parent Class
of Mammal
Sub Class of
Animal
9. Page 9Classification: Restricted
OO Relationships
• There are two kinds of Relationships
• Generalization (parent-child relationship)
• Association (one object to another object relationship)
• Associations can be further classified as
• Aggregation
• Composition
10. Page 10Classification: Restricted
OO Relationships : Generalization
Subtype2
Supertype
Subtype1
• Generalization expresses a
parent/child relationship
among related classes.
• Used for abstracting details in
several layers
Regular
Customer
Loyalty
Customer
Customer
Example
:
Regular
Customer
Loyalty
Customer
Customeror:
11. Page 11Classification: Restricted
OO Relationships : Association
• Represent relationship between instances of classes
• Student enrolls in a course
• Courses have students
• Courses have exams
• Etc.
• Association has two ends
• Role names (e.g. enrolls)
• Multiplicity (e.g. One course can have many students)
• Navigability (unidirectional, bidirectional)
12. Page 12Classification: Restricted
University Person
1
0..1
*
*
Multiplicity
Symbol Meaning
1 One and only one
0..1 Zero or one
M..N From M to N (natural language)
* From zero to any positive integer
0..* From zero to any positive integer
1..* From one to any positive integer
teacheremployee
Role
“A given university groups many people;
some act as students, others as teachers.
A given student belongs to a single
university; a given teacher may or may not
be working for the university at a particular
time.”
student
Association: Multiplicity and Roles
14. Page 14Classification: Restricted
OO Relationships : Composition
Class W
Class P1 Class P2
Whole Class
Part Classes
Automobile
Engine Transmission
Example
Composition: expresses a relationship among instances of
related classes. It is a specific kind of Whole-Part
relationship.
It expresses a relationship where an instance of the
Whole-class has the responsibility to create and initialize
instances of each Part-class.
It may also be used to express a relationship where instances
of the Part-classes have privileged access or visibility to
certain attributes and/or behaviors defined by the Whole-
class.
Composition should also be used to express relationship
where instances of the Whole-class have exclusive access to
and control of instances of the Part-classes.
Composition should be used to express a relationship where
the behavior of Part instances is undefined without being
related to an instance of the Whole. And, conversely, the
behavior of the Whole is ill-defined or incomplete if one or
more of the Part instances are undefined.
[From Dr.David A. Workman]
15. Page 15Classification: Restricted
OO Relationships : Composition
[From Dr.David A. orkman]
Class C
Class E1 Class E2
AGGREGATION
Container Class
Containee Classes
Bag
Apples Milk
Example
Aggregation: expresses a relationship among
instances of related classes. It is a specific kind of
Container-Containee relationship.
It expresses a relationship where an instance of
the Container-class has the responsibility to hold
and maintain instances of each Containee-class
that have been created outside the auspices of the
Container class.
Aggregation should be used to express a more
informal relationship than composition expresses.
That is, it is an appropriate relationship where the
Container and its Containees can be manipulated
independently.
Aggregation is appropriate when Container and
Containees have no special access privileges to
each other.
16. Page 16Classification: Restricted
Aggregations vs. Composition
• Composition is really a strong form of aggregation
• components have only one owner
• components cannot exist independent of their
owner
• components live or die with their owner
e.g. Each car has an engine that can not be
shared with other cars.
•Aggregations may form "part of" the aggregate, but may not be
essential to it. They may also exist independent of the aggregate.
e.g. Apples may exist independent of the bag.
17. Page 17Classification: Restricted
Interaction Diagrams
A Sequence diagram is an interaction diagram that shows how objects
operate with one another and in what order.
• They're also called event diagrams.
• A sequence diagram is a good way to visualize and validate various
runtime scenarios.
• These can help to predict how a system will behave and to discover
responsibilities a class may need to have in the process of
modeling a new system
19. Page 19Classification: Restricted
Class Roles or Participants
Class roles describe the way an object will behave in context. Use the UML
object symbol to illustrate class roles, but don't list object attributes.
Basic Sequence Diagram Symbols and Notations
20. Page 20Classification: Restricted
Basic Sequence Diagram Symbols and Notations
Activation or Execution Occurrence
Activation boxes represent the time an object needs to complete a task.
When an object is busy executing a process or waiting for a reply message,
use a thin gray rectangle placed vertically on its lifeline.
21. Page 21Classification: Restricted
Basic Sequence Diagram Symbols and Notations
Messages
Messages are arrows that represent communication between objects. Use
half-arrowed lines to represent asynchronous messages. Asynchronous
messages are sent from an object that will not wait for a response from the
receiver before continuing its tasks..
22. Page 22Classification: Restricted
Basic Sequence Diagram Symbols and Notations
Lifelines
Lifelines are vertical dashed lines that indicate the object's presence over
time.
23. Page 23Classification: Restricted
Basic Sequence Diagram Symbols and Notations
Destroying Objects
Objects can be terminated early using an arrow labeled "<< destroy >>" that
points to an X. This object is removed from memory. When that object's
lifeline ends, you can place an X at the end of its lifeline to denote a
destruction occurrence.
Loops
A repetition or loop within a sequence diagram is depicted as a rectangle.
Place the condition for exiting the loop at the bottom left corner in square
brackets [ ].
24. Page 24Classification: Restricted
Types of Messages in Sequence Diagram
Synchronous Message
A synchronous message requires a response before the interaction can
continue. It's usually drawn using a line with a solid arrowhead pointing
from one object to another.
25. Page 25Classification: Restricted
Types of Messages in Sequence Diagram
Asynchronous Message
Asynchronous messages don't need a reply for interaction to continue. Like
synchronous messages, they are drawn with an arrow connecting two
lifelines; however, the arrowhead is usually open and there's no return
message depicted.
31. Page 31Classification: Restricted
Sequence Diagram : Object interaction
Self-Call: A message that an
Object sends to itself.
Condition: indicates when a
message is sent. The message is
sent only if the condition is true.
Iteration
Condition
A B
Synchronous
Asynchronous
Transmission
delayed
Self-Call
[condition]
remove()
*[for each]
remove()
32. Page 32Classification: Restricted
Sequence Diagrams – Object Life Spans
• Creation
• Create message
• Object life starts at that point
• Activation
• Symbolized by rectangular stripes
• Place on the lifeline where object is
activated.
• Rectangle also denotes when object
is deactivated.
• Deletion
• Placing an ‘X’ on lifeline
• Object’s life ends at that point
Activation
bar
A
B
Create
X
Deletion
Return
Lifeline
34. Page 34Classification: Restricted
The second interaction diagram is collaboration diagram. It shows the
object organization. Here in collaboration diagram the method call
sequence is indicated by some numbering technique.
Collaboration Diagrams
36. Page 36Classification: Restricted
• Shows the relationship between objects and the order of messages passed
between hem.
• The objects are listed as rectangles and arrows indicate the messages being
passed
• The numbers next to the messages are called sequence numbers. They
show the sequence of the messages as they are passed between the objects.
• Convey the same information as sequence diagrams, but focus on object
roles instead of the time sequence.
Interaction Diagrams : Collaboration diagrams
37. Page 37Classification: Restricted
State Diagrams: (Billing Example)
State Diagrams show the sequences of states an object goes through during
its life cycle in response to stimuli, together with its responses and actions;
an abstraction of all possible behaviors.
Unpaid
Start End
Paid
Invoice created paying Invoice destroying
39. Page 39Classification: Restricted
Activity Diagram
Overview
• Activity diagram is another important diagram in UML to describe dynamic
aspects of the system.
• Activity diagram is basically a flow chart to represent the flow form one
activity to another activity. The activity can be described as an operation of
the system.
• So the control flow is drawn from one operation to another. This flow can
be sequential, branched or concurrent. Activity diagrams deals with all type
of flow control by using different elements like fork, join etc.
40. Page 40Classification: Restricted
Purpose of an Activity Diagram
• Draw the activity flow of a system.
• Describe the sequence from one activity to another.
• Describe the parallel, branched and concurrent flow of the system.
47. Page 47Classification: Restricted
UML Modeling Tools
• Rational Rose (www.rational.com) by IBM
• TogetherSoft Control Center, Borland
(http://www.borland.com/together/index.html)
• ArgoUML (free software) (http://argouml.tigris.org/ )
OpenSource; written in java
• Others
(http://www.objectsbydesign.com/tools/umltools_byCompany.html )
48. Page 48Classification: Restricted
Reference
1. UML Distilled: A Brief Guide to the Standard Object Modeling Language
Martin Fowler, Kendall Scott
2. IBM Rational
http://www-306.ibm.com/software/rational/uml/
3. Practical UML --- A Hands-On Introduction for Developers
http://www.togethersoft.com/services/practical_guides/umlonlinecourse/
4. Software Engineering Principles and Practice. Second Edition;
Hans van Vliet.
5. http://www-inst.eecs.berkeley.edu/~cs169/