Sequence Diagram

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

How to destroy an object in sequence diagrams

Put an "x" at the end of the object lifeline to show object destruction.

What does SSD stand for?

system sequence diagram

Synchronous message

the inquiring instance is blocked until result of the responding instance is returned. Marked with a solid arrow-headed line labeled with message call.

activation

thick box over object's lifeline; drawn when the object's methodis on

vertical axis in sequence diagram

time (down on page -> forward in time)

How do we show normal/concurrent (async) methods?

different arrowheads for different (async) methods

What are system events?

external input events

What is a system sequence diagram?

fast and easily created artifact that illustrates input and output events related to the system

Gate

filled circle on leftmost verge of diagram. Staring point of the interaction message sequence.

How is a message indicated?

horizontal arrow to another object message name and arguments above arrow

A frame

indicates the context of the sequence diagram.

Asynchronous message

inquiring instance does not wait for the response of the responding instance. Marked with a dotted arrow-headed line labeled with the field containing the method.

Lifeline

vertical dashed unit-less timeline. Marks creation and destruction of objects.

horizontal axis in sequence diagram

which object/participant is acting

Why use a sequence diagram?

- a good sequence diagram is still a bit above the level of the real code (not all code is drawn on diagram) - sequence diagrams are language-agnostic (can be implemented in many different languages - non-coders can do sequence diagrams - easier to do sequence diagrams as a team - can see many objects/classes at a time on same page (visual bandwidth)

Axes

Going to tell us which actor is actually doing work right now. Horizontal: which object/participant is acting. Vertical: Time(Down->forward in time)

Represented by descending dashed lines

A lifeline is...

Execution occurrence

A long narrow rectangle placed atop a lifeline. Denotes when an object is sending or receiving messages.

Step 4

Add the messages to the diagram by drawing arrows to represent the messages being passed from object to object, with the arrow pointing in the message's transmission direction.

UML sequence diagrams

An "interaction diagram" that models a single scenario executing in the system. The 2nd most used UML diagram (behind class diagram) Shows dynamic interactions between objects. Work very nicely with class diagrams.

For object destruction

An X is placed at the end of an object's lifeline to show that it is going out of existence

Participant

An object or entity that acts in the sequence diagram. (Can be a user or actor)

Representing Objects

Comment: An object without a name.

Message

Communication between participant objects

Message

Conveys information from one object to another one

Lifeline

Denotes the life of an object during a sequence.

Step 1

Determine the context of the sequence diagram

Messages is a box around lifelines with the text alt, to show a conditional flow

How do you show an alternative and what is it used for?

In a box with the word "loop" in the top left corner

How to show a loop..

Step 2

Identify the actors and objects that participate in the sequence being modeled

When is a system centralized?

If one object activates all actions

An named instance of a named class

If the word inside an object is not underline what does this mean?

When is a system distributed?

If there are multiple objects that enact actions

Actor

Is a person or system that derives benefit from and is external to the system.

An open headed arrow showing the direction of the message (starts at one lifeline, end at another) with words on top

Messages are shown as...

An arrow that points to the rectangle that symbolizes the created object

Object CREATION is shown as...

The letter x at the end of the lifeline

Object deletion is shown as...

Rectangles with underlined names

Objects are depicted as...

Key Parts of a Sequence Diagram

Participant Message Axes

Object

Participates by sending and/or receiving messages.

Step 5

Place the execution occurrence on each object's lifeline by drawing a narrow rectangle box over the lifelines to represent when the classes are sending and receiving messages.

Guard Condition

Represents a test that must be met for the message to be sent

Step 3

Set the lifeline for each object.

A box that sits on top of the lifeline corresponding with the start and end of the activation

Show an activation with...

An arrow pointing to the left

Show returns with

A vertical line. Time starts at the top and progresses towards the botton

Time is shown as...

Step 6

Validate the Sequence Diagram

Sequence Diagram and Collaboration Diagram

What are the 2 different type of Interaction Diagrams?

a parameter of the message

What do the words "newDate" mean in this code? 1.setLoadDate(newDate)

Object interactions arranged in a time sequence

What does a sequence diagram emphasize?

Represents the relative time that flow of control is focused in an object. Depicted as a box on top of a lifeline.

What is focus of control and how is it depicted?

To the left of the diagram, aligns with the object interactions

Where do you find a script? And what does it do?

Inquiries & Response: synchronous and asynchronous?

Yes

How to represent if/else statements?

[alt] frame with guard conditions separated by dotted lines for each condition and [else]

How to represent loops?

[loop] frame with guard condition(s)

How to represent if statments?

[opt] frame with guard condition

Message Condition

a condition to be met before the message can be sent. [Guard] Action format.

Sequence Diagram

a dynamic model that show the objects that participate in a use case and the explicit sequence of messages that are passed between those objects over time for one use case in a defined interaction

What is the relationship between sequence diagrams and use cases?

a sequence diagram shows system events for one scenario of a use case

sequence diagram

an "interaction diagram" that models a single scenario executing in the system perhaps 2nd most used UML diagram (behind class diagram) shows dynamic interactions b/w objects

representation of object deletion

an X at bottom of object's lifeline Java doesn't explicitly delete objects; they fall out of scope and are garbage-collected

representation of object creation

arrow with "new" written above it

How is an anonymous object represented in sequence diagram?

box with :ObjectClass

How is an object of an unknown class represented?

box with objectName on its own

How is an object represented in sequence diagram?

box with objectName:ObjectClass

message

communication between participant objects

How to indicate return from a message?

dashed arrow back

What is system behavior?

description of what a system does, without explaining how it does that

What phase are SSDs involved in?

most SSDs are created during elaboration

Instance

object involved. A box labeled with Object name : object type

participant

object or entity that acts in sequence diagram

Action Box

rectangle box on lifeline-indicates lifetime of an object.

activation box representation

rectangle lined by solid border that represents time that an object is activated

life line representation

represented by dotted line that is vertical starting at the object and runs below

condition representation in sequence diagram

represented with square brackets on arrow

Basic elements of a sequence diagram (5)

• Actors = stick man • Objects = object bit • Object lifetime = vertical dashed line • Message = Solid horizontal arrow with message name • Activation life = vertical rectangle.

Asynchronous

• Allows the developer to specify that the system does not need to wait for a response, it can get on with something else. • An open arrowhead is used to indicate that a message is asynchronous. • E.g. email, post, social media chat window.

Synchronous

• Allows the developer to specify that the system needs to wait until the receiver has finished processing the message, only then does the system respond. • Represented by a solid line with black arrow. • E.g. verbal conversation, phone

Level of abstraction for sequence diagrams

• At their most abstract, the message flow may be written as a natural language statement e.g. "Ask where the food is" • In less abstract diagrams (approaching design stage), messages correspond to a class calling a public method within another class e.g. askFoodLocation()

What are good and bad things to destroy?

• Good - any temporary object e.g. CAPTCHAS, instances • Bad - any permanent object e.g. people, databases, websites, systems, servers.

What are good and bad things to create?

• Good - things created by the process e.g. records, transaction, receipts, forms, invoices, contracts, emails, texts. • Bad - anything that exists independent of the process e.g. databases, people, website, systems, buildings.

Types of frames in Sequence Diagrams

• Loop - this shows that multiple messages are sent in the same iteration. There is also a UML loop frame guard in a condition is stated. E.g. [While more items] • Alt - used if you want to show several alternative interactions. It contains an operand for each alternative and each alternative has a guard and contains the interaction that occurs when the condition for the guard is met. E.g. [ifCash] and [else]. • opt - if you want to show that several messages are conditionally sent under the same guard. e.g [if Loyalty card not given].

Sequence Diagrams

• They demonstrate how the objects (and actors) collaborate, by showing the messages (signals and data) passed between them. • However, they do not tell you what each object does between receiving a message and replying or sending out new message.


Kaugnay na mga set ng pag-aaral

AP psych College board Questions along with word search

View Set

Exam 3 Study Questions 345 Glucose Regulation

View Set

Life Insurance Policy Provisions

View Set

Psychology Exam 1 prep - Chapter 2

View Set

Saludos y expresiones de cortesía

View Set

Intro to Entrepreneurship: Chapter 3

View Set