Closed hingen closed 1 year ago
My question is, in a sequence diagram, can we omit details such as object creation?
@hingen the example you gave doesn't concern object creation, right? But in general, yes you may omit details that are not important to the purpose of the diagram, provided the omission does not mislead the reader.
If so, are there any conditions to be met? For example, the argument name and/or context surrounding the sequence diagram must be intuitive enough for the developer to infer the meaning of the arguments.
The general condition is that the diagram must be 'fit for purpose'. If the details given are sufficient to convey whatever explanation the diagram is expected to convey, without misleading the reader, that should be good enough.
Intuitively, as developers who have a rough understanding of the code base, we can infer that
p
is thePerson
object that is to be deleted. However, I feel it can be rather ambiguous for a developer new to the code base. Perhaps a name likeperson
orpersonToDelete
would be more intuitive.
Yes, a more meaningful name can help in this case.
the example you gave doesn't concern object creation, right?
My bad, my phrasing was poorly done. My intention was to ask if we need to specify where the objects are obtained from, be it through a method call (such as the case for p
) or through a call to a constructor.
Either way, your answer addresses my issue. Thanks!
Hello. I was editing the developer documentation when I realised that the sequence diagram
ArchitectureSequenceDiagram.png
specifies an argumentp
in the method calldeletePerson(p)
. However,p
is never defined anywhere.Intuitively, as developers who have a rough understanding of the code base, we can infer that
p
is thePerson
object that is to be deleted. However, I feel it can be rather ambiguous for a developer new to the code base. Perhaps a name likeperson
orpersonToDelete
would be more intuitive.My question is, in a sequence diagram, can we omit details such as object creation?
If so, are there any conditions to be met? For example, the argument name and/or context surrounding the sequence diagram must be intuitive enough for the developer to infer the meaning of the arguments.
Screenshot: