Chapter 2 Update
Chapter 2 Update
Introduction to UML
Importance of modeling
Principles of modeling
Object oriented modeling
Overview of UML
Structural Modeling
Classes
Relationships
Diagrams
Outline (cont…)
Behavioral Modeling
Use cases
Use case diagrams
Introduction
4
Introduction to UML
UML – Introduction (cont…)
What?
A modeling language for visualizing, specifying, constructing and
documenting the artifacts of a software system.
Why?
UML is a industry standard modeling language.
Where?
Design phase (most of the time).
How?
That is what the subject is about.
UML Applicable Domains
Visualizing
Documenting
UML Specifying
Constructing
UML is a Language for Visualizing
Forward engineering
Reverse engineering
Simple names
Path name
Classes - Attributes
These attributes are similar for all the objects of the class.
The first letter in the attribute name will be in lowercase and the
first letter of the rest of the words will be in uppercase.
Classes – Attributes (cont…)
These operations are similar for all the objects of the class.
Most of the classes will have connections with other classes known as
relationships.
Dependency
Generalization
Association
Dependency
A dependency is a relationship.
Dependency is represented graphically
as a dashed directed line.
The dependency is directed towards the
thing being used.
One object dependent on the other
object. Example: object Event
dependent on object Window. Event
cannot occur independently without
Window.
Example : object Channel dependent on
object FilmClip. Channel reliable on
FilmClip to occur
29
Dependency – Example
The role is represented under the association and close to the class
icon.
Association - Multiplicity
While modeling, it is important to specify how many objects may be connected across
an association.
That “how many” is known as the multiplicity of the association.
35
Example :
One customer must have between one and five bank accounts
One person can have many employer. Company can 1 or more employee
Association - Aggregation
• Weak relationship
• Strong relationship
• Object dependent with one another
• College will never exist independent of Student
• College must have Student. Without Student, College
will be closed
40
Realization
Create a dependency pointing from the class with the operation to the
class used as a parameter in the operation.
Common Modeling Techniques -
Modeling Single Inheritance
Common Modeling Techniques -
Modeling Structural Relationships
Diagrams
Diagrams
Diagrams
Structural Behavioral
Diagrams Diagrams
Student
- sid
- sname private
- rollno
protected # email
# mobno
+ register( )
+ login( ) public
+ logout( )
Class Diagram
Class diagram
Object diagrams are used to model the static design view of the
system.
Use cases specify what the system does for its users.
Use Case diagrams show the various activities the users can
perform on the system.
System is something that performs a function.
60
Use Cases (cont…)
Order
Library :: Make
product
Reservation
Use case diagrams model the static use case view of a software
system.
70
Some Actions Supported by URS
71
Use Case Diagram - URS System 72
URS
add member
del subject
assg subject
unass subject
enrol subject
student
unenrol subject
Use Case Diagrams
73
Use Case Diagrams - Actors
75
Use Case Diagram – Example1 (Library) 76
library system
Borrow book
client employee
Reserve book
Order title
Fine payment
supplier
A Library System.
Use Case Diagram for Student 77
Assessment Management System
Grade system
Record
grades
Student
View grades
Teacher Distribute
Report cards
Create report
cards
Printing administrator
Use Case Vs Scenarios
79
Scenarios
80
Use Case Diagrams - Relationships
Inclusion
Inclusion enables to reuse one use case's steps inside another
use case.
Extension
Allows creating a new use case by adding steps to existing
use cases
Generalization
Allows child use cases to inherit behavior from parent use
cases
81
82
Links
interactions between actors and use cases, and between use cases themselves
<<include>>
indicates a use case (or base) needs to use functionality of another use case (or child) to
perform its task
Apply <<include>>
Check
Driving Qualification
License
<<extend>>
link means optional operations for a certain use case
<<extend>>
Order Search
Foods Package
83
Use Case Example
(self service machine)
Buy a product
Self service machine
customer
Collect Money
Collector
Self service machine
Restock
Supplier
84