Referring to Objects in Sequence Diagrams

If you find yourself needing to reference an object in your sequence diagram, you can name the object and then include the name in subsequent method calls. Thus, imagine you are in a situation in which a Camera object has just created a Photo object and you now need to store that photo in an Album. In your sequence diagram, you can show the Camera object creating another object whose name is "p1: Photo". Then, when you show the main program calling addPhoto() on the Album object, you can instead say addPhoto(p1). This more clearly shows that you are making use of objects created in the sequence diagram in subsequent method calls on other objects. Hope this helps!

© Kenneth M. Anderson, 2011