nus-cs2103-AY2021S1 / forum

20 stars 2 forks source link

Do sequence diagrams need to show name of methods being called? #515

Closed benclmnt closed 3 years ago

benclmnt commented 3 years ago

image

Hi prof @damithc,

  1. With regards to picture 1, is it okay to have the return label of the constructor activation bar (p) differs from the name of the object (bar)?
  2. With regards to picture 1, must the object lifeline continues outside the box or otherwise we need to show object deletion (X)?
  3. With regards to picture 2, do we need to have method call label for arrow 1 (constructor call) and arrow 2 (method call)?
  4. How should we label the arguments to a method call in a sequence diagram? e.g. a call to sort(List<Integer> numbers, boolean isMutable)
damithc commented 3 years ago
  1. With regards to picture 1, is it okay to have the return label of the constructor activation bar (p) differs from the name of the object (bar)?

That's a mistake, although unintentional.

2. With regards to picture 1, must the object lifeline continues outside the box or otherwise we need to show object deletion (X)?

No need. We assume it to continue in the absence of an X

3. With regards to picture 2, do we need to have method call label for arrow 1 (constructor call) and arrow 2 (method call)

Constructor can be omitted if obvious. But no way to know which method is being called unless stated?

4. How should we label the arguments to a method call? e.g. a call to sort(List<Integer> numbers, boolean isMutable)

sort(numbers, isMutable) should do

benclmnt commented 3 years ago

Thanks prof!