Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Link Lifeline to Class in Sequence Diagrams
Link Lifeline to Class in Sequence Diagrams [message #660143] Thu, 17 March 2011 03:28 Go to next message
Thiago Figueredo Cardoso is currently offline Thiago Figueredo CardosoFriend
Messages: 5
Registered: March 2011
Junior Member
Hi,

I created a simple Class Diagram containing two classes, Master and Slave, with a usage relationship (Master->Slave).

Now I'm trying to create a Sequence Diagram, but I can't link a Lifeline on the diagram with any of the classes. I instantiated a Lifeline but when I try to select the object this Lifeline represents, nothing appears on the selection window ("Select Represents").

Is this a bug or I'm doing it the wrong way?

Thanks in advance,

--
Thiago Figueredo
Re: Link Lifeline to Class in Sequence Diagrams [message #661352 is a reply to message #660143] Thu, 24 March 2011 10:55 Go to previous messageGo to next message
Vincent   is currently offline Vincent Friend
Messages: 35
Registered: December 2009
Member
That is because the Lifeline does not represent a Class.

Actually, in UML 2.0 a Lifeline represent an ConnectableElement object, hence an instance object which is typed by a Class.

The reason why you can not select any element is that you have not created any instance of Master nor Slave in your UML model.

A ConnectableElement can be Parameter, Property, ExtensionEnd , Port or Variable.

I do not know exactly how you can create such an instance in an appropriate manner for your case, but I hope it helps.

Vincent.
Re: Link Lifeline to Class in Sequence Diagrams [message #661974 is a reply to message #661352] Mon, 28 March 2011 16:57 Go to previous messageGo to next message
Thiago Figueredo Cardoso is currently offline Thiago Figueredo CardosoFriend
Messages: 5
Registered: March 2011
Junior Member
Hi Vincent,

That solved my problem. Smile I wasn't aware of the details of UML 2.0 and I was expecting to model the way I do in other tools.

Thanks.

Thiago
Re: Link Lifeline to Class in Sequence Diagrams [message #664145 is a reply to message #661974] Thu, 07 April 2011 15:51 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: April 2011
Junior Member
Hi Thiago/Vincent,

I've found one method to associate a lifeline to a class, but this is a workaround and I wondered if you'd found the correct way.

I presently create a property for a class, whose type I then set to the class itself, creating a recursive loop. I can then reference this property in the lifeline.

It seems to me, this adds unnecessary (and incorrect) information for the model. Do you have a better solution?

Thanks in advance, William

Re: Link Lifeline to Class in Sequence Diagrams [message #664152 is a reply to message #660143] Thu, 07 April 2011 16:14 Go to previous message
Thiago Figueredo Cardoso is currently offline Thiago Figueredo CardosoFriend
Messages: 5
Registered: March 2011
Junior Member
William,

I was doing this you described. I noticed that when you create an association between two classes, properties are created, so you may use them (it seems more accurate).

In my case, my classes weren't assoaciated to any other, so I created another class representing the top-level entity (System) and made the associations.

Thiago
Previous Topic:Drop location
Next Topic:Continuation symbol
Goto Forum:
  


Current Time: Fri Nov 28 13:54:35 GMT 2014

Powered by FUDForum. Page generated in 0.02191 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software