Professional Documents
Culture Documents
Introduction To UML
Introduction To UML
Introduction To UML
UML
Overview
What is Modeling?
What is UML?
A brief history of UML
Understanding the basics of UML
UML diagrams
UML Modeling tools
Modeling
Describing a system at a high level of abstraction
◦ A model of the system
◦ Used for requirements and specifications
<<extend>>
Use Case Diagrams
Borrow
Employee
Client
Order Title
Fine Remittance
Supervisor
(TogetherSoft, Inc)
Use Case Diagrams(cont.)
•Pay Bill is a parent use case and Bill Insurance is the
child use case. (generalization)
The visibility of the attributes and operations can be represented in the following
ways −
Public − A public member is visible from anywhere in the system. In class diagram, it
is prefixed by the symbol ‘+’.
Private − A private member is visible only from within the class. It cannot be
accessed from outside the class. A private member is prefixed by the symbol ‘−’.
Protected − A protected member is visible from within the class and from the
subclasses inherited from this class, but not from outside. It is prefixed by the symbol
‘#’.
Example
Let us consider the Circle class introduced earlier. The attributes of
Circle are x-coord, y-coord, and radius. The operations are findArea(),
findCircumference(), and scale(). Let us assume that x-coord and y-
coord are private data members, radius is a protected data member,
and the member functions are public. The following figure gives the
diagrammatic representation of the class.
An example of Class
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
•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.