Collaboration Diagrams MIT202A

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

Collaboration Diagrams

P R I NCI PLES A N D E X A MP LES


JDG A NGOSO
M I T 20 2A
Outline
Collaboration Diagrams Overview
Characteristics of a Collaboration Diagram
Guidelines in Making Collaboration Diagrams
Mini Case Interpretation
Collaboration Diagrams
Models dynamic nature of systemsinteractions between
objects or objects and external agents or actors

Dynamic based on scenarios or snapshot of the system at


a particular time (object instances)

Interactions or messages represented by requests or


function calls
Object Interactions
One of the two Interaction Diagrams, the other one being
Sequence Diagram

Both model the flow of information

Emphasizes objects that interact to support a use case,


while sequence diagrams focuses more on the details of
the messages themselves
Characteristics
Can be converted to and from sequence diagrams

Preferred diagram when analyzing in a top-down


approach to get an overview of the objects that
collaborate to carry out the activity or use case
Guidelines: Symbols
An actor who sends the An object which receives a
initial message message and sends other
messages

1:firstMessage() 2:secondMessage()
object1 object1

4:finalResponse() 3:returnMessage()

A link between symbols that A message arrow and a


send or receive messages descriptive name
Guidelines: Objects

customer :customer C:customer Helen:customer


Guidelines: Messages
Numbers indicate the order of messages

More detailed message format:

[true/false condition] sequence-number: return-value := message-name (parameter-list)


Collaboration (Look up Item Availability)
1:inquireOnItem(catalog#,prodID,size)
catalogProduct

4: returnDetails(price,desc,qty)

2:desc := getDescription(prodID) 3:qty := getQuantityOnHand(prodID,size)

productItem inventoryItem
Interaction Diagram Development
1. Identify all of the objects and actors involved in
the scenario
2. Identify each message that will be required to
carry out the scenario
a) Identify source object or actor and the destination
object or actor (can be tricky)
b) Objects can only do things to themselves
Development (2)
2. Clues in identification source and destination of
messages:
a. Identify object that needs the service
b. Identify the object that has access to the required
input parameters
c. Most one-to-many association has the one side create
and send message to the many side (especially if
independent/dependent relationship exists
Development(3)
3. Determine whether each message is always sent
or whether it is sent only under certain conditions
4. Sequence the message correctly
5. Add formal syntax on the messages if needed
6. Review and revise if changes occur
Issues of Collaboration Diagrams
Diagrams get cluttered with increasing level of messages

Cannot easily describe information about concurrent or


simultaneous messages

Does not indicate creation or deletion of objects within


the scenario
Order Scenario
:OrderEntryWindow
1:prepare()

:Order
1.1.2.1:needsToReorder()
1.1:*prepare()

:ProductOrder :StockItem
1.1.1:check()
1.1.2:[check==true]remove() 1.1.2.2:new

1.1.3:[check==true]new :DeliveryItem

:ReorderItem
Mini Cases
COLLABORATION DIAGRAMS
Deposit via Teller
Withdraw via Teller
Withdraw via ATM
Deposit with Envelope via ATM
Deposit, No Envelope via ATM
References
https://www.tutorialspoint.com/uml/index.htm
Satzinger et al (2002). Systems analysis and design in
a changing world (2nd Ed). Canada: Course
Technology

You might also like