OOSE Chapter Three
OOSE Chapter Three
-1
Chapter Three
Object-Oriented Analysis using
UML
a!sequence!diagram!for!an!emotion!based!music!player
INTERACTION USE
qAn interaction use is merely a way to indicate on a sequence diagram that
we want to reuse an interaction that is defined elsewhere.
qIn the above figure the frame labeled ref is used
to show that a login Sequence is required before the
PlanAnalyst uses the system.
qOr the frame, labeled ref, indicates that the Login
sequence is inserted (i.e., copied) where this
fragment is placed in this sequence.
qThe actual login sequence would be defined on
another sequence diagram.
SEQUENCE DIAGRAM EXAMPLE: HOTEL SYSTEM
qBelow is a sequence diagram for making a hotel reservation. The object
initiating the sequence of messages is a Reservation window.
SUMMARY OF SEQUENCE DIAGRAM CONCEPT WITH
THEIR NOTATION
qActor
§a type of role played by an entity that interacts with the subject
(e.g., by exchanging signals and data)
- represent roles played by human users, external hardware, or
other subjects.
EXAMPLE USE OF ACTOR
qLifeline
§A lifeline represents an individual participant in the Interaction.
qActivations
§A thin rectangle on a lifeline represents the period during which an element
is performing an operation.
§The top and the bottom of the of the rectangle are aligned with the initiation
and the completion time respectively
qCall!Message!(Asynchronous)
§Call message is a kind of message that represents an invocation of operation
of target lifeline.
qReturn!Message!(For!synchronous!message)
qReturn message is a kind of message that represents the pass of information
back to the caller of a corresponded former message.
qSelf!Message
§Self message is a kind of message that represents the invocation of message
of the same lifeline.
qRecursive!Message
§ Recursive message is a kind of message that represents the invocation of
message of the same lifeline.
§It's target points to an activation on top of the activation where the message
was invoked from.
SELF MESSAGE VS RECURSIVE MESSAGE
qA message to self just means that the method that
is to be invoked next happens to be in the same
class of objects.
qA recursive call is a special case of a call to self in
that it is to the same method (with a different state,
so that it can eventually return out of the recursive
calls).
qCreate!Message
§Create message is a kind of message that represents the
instantiation of (target) lifeline. Or
§We use a Create message to instantiate a new object in the
sequence diagram
qDestroy!Message
§Destroy message is a kind of message that represents the request
of destroying the lifecycle of target lifeline.
qNote
§A note (comment) gives the ability to attach various remarks to elements.
§A comment carries no semantic force, but may contain information that is
useful to a modeler.
qSequence Fragments
- A sequence fragment is represented as a box, called a combined fragment,
which encloses a portion of the interactions within a sequence diagram
- The fragment operator (in the top left cornet) indicates the type of fragment
- Fragment types: ref, assert, loop, break, alt, opt, neg
Operator Fragment Type
alt Alternative multiple fragments: only the one whose condition is true
will execute.
opt Optional: the fragment executes only if the supplied condition is true.
Equivalent to an alt only with one trace.
region Critical region: the fragment can have only one thread executing it at
once.
neg Negative: the fragment shows an invalid interaction.
ref Reference: refers to an interaction defined on another diagram. The
frame is drawn to cover the lifelines involved in the interaction. You
can define parameters and a return value.