1 lab 03. 2 what is collaboration diagram? 4 collaboration diagrams illustrate the interaction...

7
1 LAB 03

Upload: katrina-flowers

Post on 21-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 LAB 03. 2 What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4

1

LAB 03

Page 2: 1 LAB 03. 2 What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4

2

What is Collaboration diagram?

Collaboration diagrams illustrate the interaction between the objects, using static spatial structure.

Unlike sequence diagram the time is not explicitly represented in these diagrams

In collaboration diagram the sequence of messages is indicated by numbering the messages. The UML uses the decimal numbering scheme.

In these diagrams, an actor can be displayed in order to represent the triggering of interaction by an element external to the system.

This helps in representing the interaction, without going into the details of user interface.

Page 3: 1 LAB 03. 2 What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4

3

Components of collaboration diagram:

Named objects Links: Links are represented by a continuous line between objects, and

indicates the exchange of messages. Messages has following attributes:

• Synchronization --thread name, step within thread.

• Sequence number

• Message labels : The name of the message often corresponds to an operation defined in the class of the object that is the destination of the message. Message names may have the arguments and return values.

• *[iteration].

• It uses decimal notation.

• Message direction.

Page 4: 1 LAB 03. 2 What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4

4

Semantics of components:

Object names identify which objects are participating and the links show which objects collaborate

A link between two objects must exist for one object to send message to another and vice a versa.

Messages in the collaboration diagram get transformed to more detailed signature.

They use the decimal notation system for numbering the messages. The direction of the message defines the sender and receiver of

the message

Page 5: 1 LAB 03. 2 What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4

5

The elements of message:

Predecessor Role names Message qualifiers

– Iteration expression

– Parameters

– Return values

– Guard

– Message stereotypes

Concurrent thread sequencing Thread dependencies Message expression

[Pre] A1:*(expression):doIt(p,r):return value

Page 6: 1 LAB 03. 2 What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4

6

The examples of message:

4:Display(x,y) Simplemessage

3.3.1:Display(x,y) Nestedmessage

4.2:subtract[Today,Birthday]:age Nestedmessage withreturn value

[Age >=18] 6.2:Vote() Conditionalmessage

4.a,b.6/c.1:Turnon(Lamp) Synchro. withother flow ofexecution

1*:wash() Iteration

3.a,3.b/4*||[i:=1..n]:Turnoff() Paralleliteration

Page 7: 1 LAB 03. 2 What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4

7

Collaboration diagram [for withdrawal of cash, normal flow.]

1. Insert cardEnter password, Enter kindEnter amount,Take cash, Take cardcancel,Terminate, Continue

Display main screen unreadable card message,request password,request kind, request amount,canceled message, eject card, failure message,dispense cash, request take cashrequest continuation,print receipt, request take cardbad account message,bad bank account message

Verify account,process transaction

Transaction succeedTransaction failedaccount o.k.bad account,bad password,bad bank code

Create TransactionTransaction complete

CUST-OMER

BANK

ATM TRANSA-CTION