nus-cs2103-AY2324S2 / forum

16 stars 0 forks source link

Sequence diagram constructor #890

Closed tankh99 closed 6 months ago

tankh99 commented 7 months ago

Do we really need to draw an arrow from the left side to create the Dog class here? Can we just omit the arrow to the class dog? image

E0735389 commented 7 months ago

As far as I can see, the highlighted code calls the constructor, so it would be suitable to draw the arrow.

Simplification (omitting unimportant detail) is possible, but that may mislead the reader into thinking that the object d has always been there.

tankh99 commented 6 months ago

This makes sense, thank you @E0735389

damithc commented 6 months ago

@E0735389's answer is correct. The Dog object is created during this interaction. You can omit that object entirely, to simplify. But if you include it in the diagram, omitting the construction of it can mislead the reader to think it existed from the beginning.