Uml PPT
Uml PPT
Overview
What is Modeling?
What is UML?
A brief history of UML
Understanding the basics of UML
UML diagrams
Modeling
Class Diagram
Sequence Diagram
Collaboration Diagram
State Diagram
<<extend>>
Use Case Diagrams
Borrow
Employee
Client
Order Title
Fine Remittance
Supervisor
(TogetherSoft, Inc)
Use Case Diagrams(cont.)
Name
Account_Name
- Customer_Name
Attributes
- Balance
+addFunds( ) Operations
+withDraw( )
+transfer( )
OO Relationships
Regular Loyalty
Customer Customer
Subtype1 Subtype2
or: Customer
- Generalization expresses a
parent/child relationship among related
classes.
- Used for abstracting details in several Regular Loyalty
layers Customer Customer
OO Relationships: Association
University Person
0..1 *
employer teacher
Role
Multiplicity
Symbol Meaning
1 One and only one Role
0..1 Zero or one “A given university groups many people;
M..N From M to N (natural language)
some act as students, others as teachers.
A given student belongs to a single
* From zero to any positive integer university; a given teacher may or may not
0..* From zero to any positive integer be working for the university at a particular
1..* From one to any positive integer time.”
Class Diagram
Name Order class
Multiplicity: mandatory
-dateReceived
Attributes -isPrepaid Customer
-number :String
-price : Money
* 1 -name
-address
+dispatch() Association +creditRating() : String()
Operations +close()
1
{if Order.customer.creditRating is Generalization
"poor", then Order.isPrepaid must
be true }
0..1
Multiplicity:
optional *
Employee
*
OrderLine
-quantity: Integer 1
* Product
-price: Money
-isSatisfied: Boolean
Class Student {
Course enrolls[4];
}
Class Course {
Student have[];
}
OO Relationships: Composition
Composition: expresses a relationship among instances
Whole Class of related classes. It is a specific kind of Whole-Part
Class W relationship.
Apples Milk
Aggregation vs. Composition
•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.
Sequence Diagram(make a phone call)
Picks up
Dial tone
Dial
Picks up
Hello
Sequence Diagram:Object interaction
A B
[condition] remove()
Condition
*[for each] remove()
Iteration
Self-Call
Sequence Diagrams – Object Life Spans
Creation
A
Create message
1: look up ()
2: title data ()
4 : title returned ()
5: hold title ()
5 : title available ()
6 : borrow title ()
6 : remove reservation ()
start
6: remove reservation
1: look up
2: title data
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)
Start End
Unpaid Paid
Invoice created paying Invoice destroying
State Diagrams
(Traffic light example)
Yellow
Green
Event