Book a Demo

Author Topic: It's my first sequence diagram & I'm confused!  (Read 3142 times)

Jim.Stanley

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
It's my first sequence diagram & I'm confused!
« on: June 17, 2004, 09:58:49 am »
I'm reverse engineering what looks like a badly written object model;  I've done some great class diagrams using EA, and am now trying to model a particular process (how an object and child objects paint themselves on screen) and have the following questions:

1)  Is there a special way to handle incoming messages from the system on a sequence diagram?  So far, I've created a "windows paint message" object that sends a Paint() message , but perhaps there's a better way to indicate that "the system has told this object to paint itself".

2) At one point in the diagram, there is an iteration through a list of objects;  they may be child classes, but all I know is that they are a list of an abstract class type (think of triangles, squares, and circles drawing themselves, but all I know is that I'm iterating through ShapeList).  My boss is telling me that having an abstract object on the diagram makes no sense (fair enough), but what's the alternative?

Sorry for the "newbie"ness here - I really want to create a lucid diagram, but am fairly bollixed up at this point.  Any help would be welcome.

Thanks

Jim Stanley
Media Services, Inc.

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Re: It's my first sequence diagram & I'm confu
« Reply #1 on: June 17, 2004, 10:20:19 am »
Hi Jim,

in my opinion sequence Diagrams are the most complex diagrams in uml. There are so many diffrent opinions how to use them in the right way, so that it's not wondering that you are confused.

I think sequence diagrams can only be used to show some special cases of the behavior of your application. One reason for that is, that there is no possibility in UML to show a abstract object (so your boss is right).

The better way is to choose some shapes (two or three) and show the behavior of the Paint() message with this list. I think with this example the concept should be clear.

If there is a much more complex stuff for other shapes, draw a seperate seqence diagram.

hope that helps.
bye
Andreas

angel-o-sphere

  • EA User
  • **
  • Posts: 112
  • Karma: +0/-0
    • View Profile
Re: It's my first sequence diagram & I'm confu
« Reply #2 on: June 18, 2004, 03:27:39 am »
Hi,

1) if you need messags comming from the system, place a "System Object" on your Sequence Diagramm (you even can define types/classes like "WindowingSystem" for such objects)

2) While objects are concrete (in real world you can touch them most of the time) their type still can be abstract. So in case you have made the object abstract by clicking the abstract check box, make it concrete again. However: nothing prevents you from assigning a abstract classifier in an "instanciates" relation (or better use the instanciates tab in the object), so your boss is wrong here.

3) Often it is not necessary to "iterate" with complicated Sequence Diagrams over items from a collection. Just use the collection allone and use a message like "For All: draw()" or in english: "draw all items".

4) Well, the use of sequence diagrams is well defined. Albeit there are more than one usage :D

You use them to find methods/operations. As soon as you have a classifier to your objects attached, you can walk through your sequence diagramms and open all messages and assign an operation via that message to the target classifier.

In case you allready have a lot of operations in your classifiers you use sq diagrams like this: during drawing of new sequence diagrams you pick from those operations for drawing new messages if they are appropriated or you add new operations to the classes directly from the sq diagram.

angel'o'sphere