Book a Demo

Author Topic: Object Instances on Sequence Diagrams  (Read 8681 times)

Barrie Treloar

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Object Instances on Sequence Diagrams
« on: June 02, 2009, 09:53:00 am »
I seem to have a brain fade but I can not work this one out.

I am creating a sequence diagram and the lifeline elements look like object instances with no class associated with them.

I can find no documentation that explains how to create a sequence diagram with the varying options:
  • An anonymous instance of a class ":MyClass"
  • A named instance of a class "me:MyClass"
  • A named instance of no type "someone"

So far all my lifelines are like the third type "someone".

I need this to ensure I dont suffer from the "Sequence Diagrams and Version Control" problem.

Cheers

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Object Instances on Sequence Diagrams
« Reply #1 on: June 02, 2009, 11:38:47 am »
Two choices:

Ctrl+Drag a class onto a sequence diagram and EA will ask whether you want to create an instance of the class.

Select one of your unclassified lifelines and press Ctrl+L to select a classifier for it.
The Sparx Team
[email protected]

Barrie Treloar

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Object Instances on Sequence Diagrams
« Reply #2 on: June 02, 2009, 11:58:18 am »
Is there a link to this in the documentation please?

When using Ctrl+Mouse I can tell I have previously selected "As Simple Link" and made that the default.  Is there an explanation of the difference? (there is no context help button on that dialog) Same comment for "Set Selection as Default For" option.

Ctrl+L doesnt behave as I expected. (Is there a link to the documentation?)
It makes the existing component into a component instance - rather than turning the element on the diagram into a component instance.
I'll ignore Ctrl+L for now as pasting an instance into the diagram is probably the way I want it to work anyway.

Thanks

Barrie Treloar

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Object Instances on Sequence Diagrams
« Reply #3 on: June 02, 2009, 12:31:41 pm »
Now that I am creating object instances I have another query.

I have placed all my classifiers into another package as per "Sequence Diagrams and Version Control".

If I drop an interface onto the diagram the instance appears underneath the diagram in the browser.

If I drop a component onto the diagram the instance appears at the same level as the diagram in the browser.

Is there a reason for this?

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Object Instances on Sequence Diagrams
« Reply #4 on: June 02, 2009, 02:14:05 pm »
In response to your 11:58 am posting, the Help for the copy and paste dialog is here:

http://www.sparxsystems.com/uml_tool_guide/modeling_with_uml/pastingfromthetree.html

What happened when you pressed [Ctrl]+[L] on the element? The Set Instance Classifier dialog should display, as documented here:

http://www.sparxsystems.com/uml_tool_guide/modeling_with_uml/usingclassifiers.html

I hope these help.
Best Regards, Roy

Barrie Treloar

  • EA User
  • **
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: Object Instances on Sequence Diagrams
« Reply #5 on: June 02, 2009, 02:46:12 pm »
Thanks those links are helpful.
I didn't find the Modeling With UML > Diagrams notes to make use of that information.

The "Drop Elements from Project Browser" is also handy.
I'm not sure how I want the behavior as I have not thought this through completely, but I really only expect object instances to be created on Interaction diagrams (maybe deployment diagrams too) I'll fiddle with the options to see if I can get that.

As for Ctrl+L, yes it brought up the Set Instance Classifier dialog - but since my diagram had a link to the classifier it was the classifier that had the instance attached to it.  What I was looking for was "Context Menu > Advanced > Convert to Instance" (which I can't recall where in the documentation I found this bit)

This just leaves the question of why object instances are creatred at different levels in my project browser when I am dropping them into the same diagram.

Many thanks.