Professional Documents
Culture Documents
Notes - 1058 - Unit III
Notes - 1058 - Unit III
Outline
• Introduction
• Use case model
• Unified Modeling Language
• Actor
• Use cases
• UC Description Properties
• Relationships between Actors
• Use Case Relationships
Sharif Univ. of Tech. 2
Elements of Use-case Model
• The components of a Use-case model are:
– System Modeled/ System Boundary System Name
– Actors
name
– Use-cases Use-case
– Stimulus
– Relationships
• Among usecases
• Between actor and usecase
• Among actors
3
System and Its Boundary
• As a part of the use-case modeling, the boundaries
of the system are developed.
• System lies within the boundary and outside the
boundary is environment of the system
• System in the use-case diagram is a box with the
name appearing on left top corner pentagon.
• Define the scope of the system that you are going to
design
• Actors are not part of the system. They lie outside
the boundary of the system
5
Actors
• An actor is something or someone or device or
another system that interacts with the system.
• Actor communicates with the system by sending
and receiving messages.
• An actor activates the system.
• Actors can be primary/secondary; passive/active.
• Actor is a role not an individual instance.
• Actor is source and sink for a system means gives
input to system or consumes output from the
system
6
Notations for Actor in UML
Finding Actors
• The actors of a system can be identified by answering
a number of questions:
– Who will use the functionality of the system?
– Who will maintain the system?
– What devices does the system need to handle?
– What other system does this system need to interact?
– Who or what has interest in the results of this system?
Use-cases
• A Use-case in UML is defined as a set of sequences of
actions a system performs that yield an observable result
of value to a particular actor.
• Actions can involve communicating with number of actors
as well as performing calculations and work inside the
system.
• A Use-case
– is always initiated by an actor.
– provides a value to an actor.
– must always be connected to at least one actor.
– must be a complete description.
Finding Use-cases
• For each actor ask these questions:
– Which functions does the actor require from the system?
– What does the actor need to do?
– Could the actor’s work be simplified or made efficient by
new functions in the system?
– What events are needed in the system?
– What are the problems with the existing systems?
– What are the inputs and outputs of the system?
Relationships among usecases
• Generalization
• Includes
• Extends
Generalization relationship among
usecases
Include relationship between use cases
Extend relationship between use cases
Extend relationship between use cases
Interaction Modeling
Interaction Diagrams
• It describes the dynamic behavior of a system.
– A set of messages exchanged among a set of
objects within a context to accomplish a purpose.
• It models the way a use case is realized
through a sequence of messages between
objects.
Sequence Diagrams 18
Interaction Diagrams in UML
– Sequence Diagram
– Collaboration Diagrams
19
Sequence Diagram
• It illustrates how objects interact with each
other.
• Emphasizes time ordering of messages.
• Can model simple sequential flow, branching,
iteration, recursion and concurrency.
20
Elements of Sequence Diagram
• Object
• Lifeline
• Activation box
• Messages
– Synchronous message
– Asynchronous message
– Constructor
– Destructor
21
Object
user: :Book
book:Book
LibraryMember Copy
borrow(book) Object
Life
ok = mayBorrow()
Y-Axis (time)
Line
message
Activation
[ok] borrow(member)
setTaken(member) box
condition
23
Messages
24
Messages
• A message is labeled with its name.
• Arguments and control information are optional.
• Return values are optionally indicated using a dashed arrow
25
Synchronous Messages
• A message which returns value is called
synchronous message.
:A :B
areYouReady()
return
yes (optional)
Object Creation (constructor
Message)
• An object may create another object via a
<<create>> message.
Preferred
:A :B :A
<<create>> <<create>>
:B
Object Destruction message
:A :B
<<destroy>>
Control information
• Condition
– syntax: ‘[‘ expression ’]’ message-label
[ok] ejectMoney(Card)
• Iteration examples:
draw()
*draw() *[until full] insert()
Sequence Diagram
:Printer
:PrintServer :Queue
Proxy
Client
print(doc,client) enqueue(job)
job=dequeue()
[job]print(job.doc)
status
[job] done(status)
Activity Modeling
• Outcome of activity modeling is activity
diagram.
• Activity diagrams consists of nodes and arcs
• Activity diagram can be called object-oriented
flowchart
Elements of Activity Diagram
• Nodes: Three types of nodes
1. Action Node (four types)
– Call node
– Send signal node
– Accept Event node
– Accept time event node
Elements of Activity Diagram
• Nodes: Three types of nodes
2. Control Node (seven types)
– Initial node
– final node
– Flow final node
– Decision node
– Merge node
– Fork node
– Join node
Elements of Activity Diagram
• Nodes: Three types of nodes
3. Object Node
Flows in activity diagram (two types)
– Control flow
– Object flow
References
1. Grady Booch, James Rumbaugh, Ivar Jacobson,
The Unified Modeling Language User Guide,
Pearson Education
2. Michael Blaha, James Rumbaugh: Object-
Oriented Modeling and Design with UML, 2nd
Edition, Pearson Education, 2005.
3. J. Rambaugh, M. Blaha, W. Premerlani, F. Eddy, W. Lorensen,
Object-Oriented Modeling and Design, Prentice Hall of India
4. Satzinger, Jackson, Burd, Object-Oriented Analysis & Design
with the Unified Process, Thomson.
5. Grady Booch, Object Oriented Analysis & Design, Pearson
Education