Professional Documents
Culture Documents
Acknowledgements
www.sts.tu-harburg.de/ teaching/ws-98.99/OOA+D/3-0-UML.pdf
Overview
What
is Modeling?
What
is UML?
A brief
history of UML
Understanding
UML
diagrams
UML
Modeling tools
Modeling
History of UML
What is UML?
Use Case
Actor
Library System
Borrow
Employee
Client
Order Title
Fine Remittance
Supervisor
(TogetherSoft, Inc)
Class diagram
Class representation
Name
Attributes
Operations
+ is used to denote
#
derived)
is used to denote
An example of Class
Account_Name
- Customer_Name
- Balance
+addFunds( )
+withDraw( )
+transfer( )
Name
Attributes
Operations
OO Relationships
Aggregation
Composition
OO Relationships: Generalization
Supertype
Example:
Customer
Regular
Customer
Subtype1
Loyalty
Customer
Subtype2
or:
Customer
- Generalization expresses a
parent/child relationship among related
classes.
- Used for abstracting details in several
layers
Regular
Customer
Loyalty
Customer
OO Relationships: Association
Student
enrolls in a course
Courses
have students
Courses
have exams
Etc.
Role
Multiplicity
students)
Navigability
(unidirectional, bidirectional)
University
Person
0..1
employer
*
teacher
Role
Multiplicity
Symbol
Meaning
0..1
Zero or one
M..N
0..*
1..*
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.
Class Diagram
Name
Order
Attributes
Operations
-dateReceived
-isPrepaid
-number :String
-price : Money
*
Association
-name
-address
+creditRating() : String()
{if Order.customer.creditRating is
"poor", then Order.isPrepaid must
be true }
(inside braces{}}
Many value
Generalization
Corporate Customer
Personal Customer
-contactName
-creditRating
-creditLimit
-creditCard#
Constraint
Multiplicity:
Customer
+dispatch()
+close()
class
Multiplicity: mandatory
+remind()
+billForMonth(Integer)
0..1
Multiplicity:
optional
*
Employee
*
OrderLine
-quantity: Integer
-price: Money
-isSatisfied: Boolean
Product
Student
has
Class Student {
Course enrolls[4];
}
Class Course {
Student have[];
}
4
enrolls
Course
OO Relationships: Composition
Composition: expresses a relationship among instances
of related classes. It is a specific kind of Whole-Part
relationship.
Whole Class
Class W
Class P2
Part Classes
Example
Automobile
Engine
Transmission
OO Relationships: Aggregation
Container Class
Aggregation: expresses a relationship among instances
of related classes. It is a specific kind of ContainerContainee
relationship.
Class C
AGGREGATION
Class E2
Class E1
Containee Classes
Example
Bag
Apples
Milk
Class
Reservations
Responsibility
Handle reservation
Collaborators
Catalog
User session
Phone
Recipient
Picks up
Dial tone
Dial
Ring notification
Ring
Picks up
Hello
Sequence Diagram:Object
interaction
A
Self-Call:
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.
B
Synchronous
Asynchronous
Transmission
delayed
[condition] remove()
Condition
*[for each] remove()
Iteration
Self-Call
Creation
A
Create message
Activation
Deletion
Activation bar
Placing an X on lifeline
Return
X
Deletion
Sequence Diagram
Message
User
Catalog
Reservations
1: look up ()
2: title data ()
3: [not available] reserve title ()
4 : title returned ()
5: hold title ()
5 : title available ()
6 : borrow title ()
6 : remove reservation ()
Sequence
The
The
Reservations
5: title available
6 : borrow title
2: title data
1: look up
4 : title returned
Catalog
5 : hold title
Shows
the relationship between objects and the order of messages passed between them.
between them.
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.
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.
End
Start
Unpaid
Invoice created
Paid
paying
Invoice destroying
State Diagrams
(Traffic light example)
Traffic Light
State
Transition
Red
Yellow
Green
Event
Start
Activity Diagrams
Fancy flowchart
Swim lanes
Branch
Indicated by a diamond
Fork
Ordering System
Component Diagrams
Shows
Explains
Usually
Similar
With
ordering system
Define interfaces
first comes
from Class
Diagrams
Deployment Diagrams
Deployment Example
Microsoft Visio
Visual Paradigm
(http://www.borland.com/together/index.html)
Others (http://www.objectsbydesign.com/tools/umltools_byCompany.html )
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/
5. http://www-inst.eecs.berkeley.edu/~cs169/