• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

objectname in sequence diagrams?

 
D. Rose
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I read some UML guideline that suggest we only use object names in sequence diagrams if we are referring to particular object insatnce else just show :classname instead of objectname:classname in sequence diagrams.

Any comments? Is is OK to do it this way?
 
H. Hafer
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by D. Rose:
Hi,

I read some UML guideline that suggest we only use object names in sequence diagrams if we are referring to particular object insatnce else just show :classname instead of objectname:classname in sequence diagrams.

Sometimes you even have to omit names. EJBs for example, why sould you know their identity?

Cheers,
Harbo
[ September 06, 2004: Message edited by: H. Hafer ]
 
D. Rose
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not only EJB's. I think for that matter we can drop object names for all instances except may be if we are using something like singleton where we refer to only particular reference.
 
Renaud FLORQUIN
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The objectname in sequence diagram can refer to the role name of an association defined in class diagram.
For example, I have a class diagram with two class A and B, and there is an association between A and B (B plays a role in this association: 'roleB').
The sequence diagram can illustrate a scenario where a instance of A calls a service of an instance of B but not any instance of B but the 'associate' instance of B: In this case, we can specify in the sequence diagram: 'roleB:B'
It can be useful to make the link between structural diagrams and behavioural diagrams; often this link is not very clear.

Renaud
 
D. Rose
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Renaud ,

Using role in sequence diagram seems good but I think it would be useful only if there are multiple roles in question.
Also is it a standard UML practise? Just wanted to know more.
 
Renaud FLORQUIN
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I add a message from one object to another on a sequence diagram, I ask myself how this object know the other one; sometimes the reference of the destination object comes from the flow of information (previous message), sometimes it comes from a link (association) between two objects.
It helps me to validate my model: Does my static model (structural information) give me enough information to realize the behavior.
It depends also of the level of abstraction: At architectural level it is not so easy (or helpful) to add this information.

For UML point of view, there is no constraint about the first part of the indentification (object name).

Renaud
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Fowler refers to this issue in UML Distilled:

Most of the time, you can think of the participants in an interaction diagram as objects, as indeed they were in UML 1. But in UML 2, their roles are much more complicated, and to explain it all fully is beyond this book. So I use the term participant, a word that isn't used formally in the UML spec. In UML 1, participants were objects as so their names were underlined, but in UML 2, they should be shown without the underline, as I've done here.


Regards,
Dan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic