Author Topic: Show/copy relationships  (Read 8977 times)

Adam

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Show/copy relationships
« on: April 04, 2007, 06:16:44 pm »
Is there any way to show or copy relationships specified between elements to element instances.

For example, I've got Components or Classes with relationships like dependencies or associations, I have some objects or instances of components on a diagram and I'd like to show the same relationships between them as specified on the actual components.

Is it possible?

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: Show/copy relationships
« Reply #1 on: April 04, 2007, 10:36:47 pm »
Hi Adam,

the links are run-time instances of associations. "An association specifies a semantic relationship that can occur between typed instances." (UML Superstructure Specification 2.1.1 chapter 7.3.3)
That mean you cannot show them until you define them (until you explicitly say, that such a link on your diagram has a sense). You cannot copy them; it is a different level (abstraction/instance). You want to instantiate them.

And as a conclusion: I don't know how to achieve it. Anyone else does?
Jan 'Bary' Glas

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Show/copy relationships
« Reply #2 on: April 05, 2007, 01:37:30 am »
I thought there was an option somewhere to make a copy of a set of elements including the relationships between them.

EDIT: Here it is. The deep copy will create new instances of the elements, as well as new connectors between them. Both the elements and the connectors can then evolve independently.

EDIT: The EA help file (build 805) refers to the other (i.e. not "deep") copy option as "shenable" rather than "shallow" as is shown on the dialog. I've reported the flaw.
« Last Edit: April 05, 2007, 02:18:42 am by Midnight »
No, you can't have it!

KjellElster

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Show/copy relationships
« Reply #3 on: April 13, 2007, 01:58:35 am »
I don't think this is what Adam is after.

My guess he's looking for a way to instanciate an association. Like you instanciate an object from a class.

As Jan Glas says, there seems to be no way of doing that with EA. From the interface I have drawn the conclusion that instanciating an object from a class also was impossible and someone made that possible through special case operation. E.g. why can't change the class of an object? Not even from <null> to SomeClass?

I have further more not found a way to show values for attribute(-instances) for the objects.

These problems makes it hard to make "story boards" with EA.

KjellElster

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Show/copy relationships
« Reply #4 on: April 13, 2007, 01:58:52 am »
I don't think this is what Adam is after.

My guess he's looking for a way to instanciate an association. Like you instanciate an object from a class.

As Jan Glas says, there seems to be no way of doing that with EA. From the interface I have drawn the conclusion that instanciating an object from a class also was impossible and someone made that possible through special case operation. E.g. why can't change the class of an object? Not even from <null> to SomeClass?

I have further more not found a way to show values for attribute(-instances) for the objects.

These problems makes it hard to make "story boards" with EA.

KjellElster

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Show/copy relationships
« Reply #5 on: April 13, 2007, 02:02:49 am »
I don't think this is what Adam is after.

My guess he's looking for a way to instantiate an association. Like you instantiate an object from a class.

As Jan Glas says, there seems to be no way of doing that with EA. From the user interface I have drawn the conclusion that instantiating an object from a class also was impossible and someone made that possible through special case operation. E.g. why can't change the class of an object? Not even from <null> to SomeClass?
The EA's meta model seems not to support this easily.

I have further more not found a way to show values for attribute(-instances) for the objects.

These problems makes it hard to make "story boards" with EA.

KjellElster

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Show/copy relationships
« Reply #6 on: April 13, 2007, 04:35:33 am »
I don't think this is what Adam is after.

My guess he's looking for a way to instantiate an association. Like you instantiate an object from a class.

As Jan Glas says, there seems to be no way of doing that with EA. From the user interface I have drawn the conclusion that instantiating an object from a class also was impossible and someone made that possible through special case operation. E.g. why can't change the class of an object? Not even from <null> to SomeClass?
The EA's meta model seems not to support this easily.

I have further more not found a way to show values for attribute(-instances) for the objects.

These problems makes it hard to make "story boards" with EA.

thomaskilian

  • Guest
Re: Show/copy relationships
« Reply #7 on: April 17, 2007, 03:28:23 am »
Maybe you can explain why you want the relations to be copied. As the objects are instanciated, they already inherit the relations from the underlying classes. So what would be the point in copying them?

KjellElster: You can remove your duplicate posts by using the Remove button
« Last Edit: April 17, 2007, 03:30:48 am by thomaskilian »

JohnWSaundersIII

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: Show/copy relationships
« Reply #8 on: April 18, 2007, 08:56:55 am »
Quote
As the objects are instanciated, they already inherit the relations from the underlying classes. So what would be the point in copying them?


I just created an object diagram. I dragged into it class ClassA that has an association to ClassB, which I also dragged into the diagram. I chose the "instance" option in the dialog that comes up when you drop.

Although the two classes are joined by an association, the two objects are not joined by a link. I even tried Insert Related Elements on both objects, and there was no effect.

Is this the behavior you would expect? I would have expected links to be created for all such objects, or at least to be easily creatable.

John

P.S. The duplicate posts by the other poster may have been caused by the server error I just saw in posting this. I tried again, and found I had two copies of the post. I was told to inform [email protected].
« Last Edit: April 18, 2007, 08:58:40 am by JohnWSaundersIII »
John Saunders

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Show/copy relationships
« Reply #9 on: April 18, 2007, 02:06:22 pm »
John,

If you have two instances, then this is not a case where you are joining two "classes" but one where you are joining two objects. So, the relationship should not be automatically propagated. EA has it correct.

I'm sorry, but I don't have the answer to the rest of your questions.

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Show/copy relationships
« Reply #10 on: April 18, 2007, 02:20:07 pm »
Quote
E.g. why can't change the class of an object? Not even from <null> to SomeClass?

Ctrl+L (Right-click > Advanced > Instance Classifier)

Quote
I have further more not found a way to show values for attribute(-instances) for the objects.

Ctrl+Shift+R (Right-click > Advanced > Set Run State)
The Sparx Team
[email protected]

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Show/copy relationships
« Reply #11 on: April 18, 2007, 02:30:16 pm »
Quote
I just created an object diagram. I dragged into it class ClassA that has an association to ClassB, which I also dragged into the diagram. I chose the "instance" option in the dialog that comes up when you drop.

Although the two classes are joined by an association, the two objects are not joined by a link. I even tried Insert Related Elements on both objects, and there was no effect.

Is this the behavior you would expect?

I'd say so. Consider a class diagram with an Address class and a Person class with a "livesAt" association between them. Ctrl+Drag one of each onto an object diagram, call them "KP:Person" and "BuckinghamPalace:Address". I wouldn't want EA to automatically create a "livesAt" association.


Quote
I would have expected links to be created for all such objects, or at least to be easily creatable.

I'd say they are easily creatable, using the toolbox or the quicklinker, the same as any other connector :)
« Last Edit: April 18, 2007, 02:31:08 pm by KP »
The Sparx Team
[email protected]

sl@sh

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Show/copy relationships
« Reply #12 on: April 18, 2007, 10:26:13 pm »
Quote
I'd say so. Consider a class diagram with an Address class and a Person class with a "livesAt" association between them. Ctrl+Drag one of each onto an object diagram, call them "KP:Person" and "BuckinghamPalace:Address". I wouldn't want EA to automatically create a "livesAt" association.

I agree with respect to creating instances on a diagram, but what is the Insert Related Elements function good for if not for putting associated objects onto the diagram and the accompanying relationships?

What you are saying, is that this function shouldn't do anything for instances. I beg to disagree.

thomaskilian

  • Guest
Re: Show/copy relationships
« Reply #13 on: April 18, 2007, 10:29:34 pm »
The Insert Related Elements is meant to help you creating an overview for an element to see the element and all the related ones.

sl@sh

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Show/copy relationships
« Reply #14 on: April 18, 2007, 10:37:36 pm »
Quote
The Insert Related Elements is meant to help you creating an overview for an element to see the element and all the related ones.

Well, if related elements only includes elements that you have personally and manually drawn the relationships for, what is the point? You already have them on the diagram...
« Last Edit: April 18, 2007, 10:38:30 pm by sl@sh »