Lisa
Lisa

Reputation: 3181

How to represent mutiple calls in Seq diagram

I have a question, if I have a code with a class that has a main function that creates objects of all other classes in the system and then make calls to some methods from these objects. My question is if this main function call a method of one object twice (with different parameters) how can I represent that in a sequence diagram at is thresembling the flow of the main method?

Upvotes: 0

Views: 993

Answers (2)

Red Beard
Red Beard

Reputation: 3506

Please find below a sequence diagram describing the following seqeunce: - Creation of an instance b of type B - Creation of an instance a1 of type A - Creation of an instance a2 of type A - Call of the operation Foo defined on B with a1 as parameter - Call of the operation Foo defined on B with a2 as parameter

enter image description here

Upvotes: 1

Rainer Berger
Rainer Berger

Reputation: 211

In a sequence diagram, time is represented a going down vertically. For first function call, you would have an invocation from the object containing your main function to the object that you created, and you can annotate that invocation with the parameters used. For the second function call, you simply draw the second invocation below the first one, again you can annotate that with the parameters to be used.

Upvotes: 0

Related Questions