views:

41

answers:

1

I was just wondering if it is more correctly to as a label of objects in UML sequence diagram instead of object name (which is irrelevant in my opinion and less informative than class name) provide class name. Another thing, while returning information instead of listing all objects names would it be a better solution to just write collection;

Diagram with object names:alt text

Diagram with class names: alt text

As it's clearly visible from the second diagram that it is much more informative than the first one, and I think it is more practical.

+2  A: 

Sequence diagrams always represent interactions between objects. When showing the name of the object you can just use the object name (agreed, not useful in general), the syntax "object:class" (important when you are modeling a specific scenarion in which the name of the object is relevant to understand the scenario) or just " :class" (here you are using an anonymous object to indicate that the scenario applies to all objects of the class).

Jordi Cabot
And what about the returning value? Do we have to list concrete values?
There is nothing we can do
again, this depends on the importance of that value (e.g. if you use that as input of a call to another object further down in the diagram)
Jordi Cabot
So basically what you're saying it isn't strict in a sense that you have just one way to present those things and you have some margin of freedom? Am I right?
There is nothing we can do
Exactly. You can create sequence diagrams with different levels of detail.
Jordi Cabot
@Jordi Thanks a lot.
There is nothing we can do