Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsAbstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716706/#msg_716706
I have an ecore model with an Abstract Class. I have defined links at the level of the abstract class.
Case in Point: Abstract class is "Person" and has concrete classes "Male" and "Female". I have defined EReference links at the abstract class level such as Person "friend of" Person. What essentially is happening is that when I try to derive grapical difinitions and also derive the tool pallete elements, the EReference link "friend-of" is replicated for each concrete class in this case it is replicated for Male and Female: If I had five concrete classes this link will be replicated 5 times. I will have 5 icons on the tooling palette. What I need is to have ONE link as defined at the abstract class level and this link is not replicated(in child classes). The concrete or child classes, I would assume should be able to use a link at the parent(abstract) class level. This does not seem to happen. I have tried to change the abstract(parent) class to a concrete class but this also adds more confusion as longs as there is the parent/child inheritance.
Could someone please advise on what to do in such as situation? What are the capabilities of GMF as far as inheritance in concerned. Thanks in advance.]]>Mark Ssebunnya2011-08-18T07:31:30-00:00Re: Abstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716709/#msg_716709
try to delete all but one of this mappings in the gmftool model. Then you should map both link mappings in the gmfmap model to the same model elememt in gmftool model.
Ralph]]>Ralph Gerbig2011-08-18T07:40:13-00:00Re: Abstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716758/#msg_716758
Many Thanks,
I have tried that. If I understand you correctly.
In the GMFtool I remained with one link. (In this example the friend-of): "Creation Tool Friendof"
Then in the gmfmap I create two link mappings each to use the same model elememt in gmftool. I have the this
Link Mapping <{Person.friendof.Person)/MalePerson>
Link Mapping <{Person.friendof.Person)/FemalePerson>
What happens to gmpgraph? I have two "Connection MalePersonFriendOf" and "Connection FemalePersonFriendOf"
The person case I am using as simplified example. My ideal case is the attached ecore file diagram where I have more links at the abstract class level. The other issues I end up with is that the tool interchanges links with nodes as seen in the attached screenshot with red.
Two attachments: ECore and Editor Screenshot
Many Thanks for the help.
Mark
]]>Mark Ssebunnya2011-08-18T10:57:17-00:00Re: Abstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716768/#msg_716768
please open a new thread for your second issue. So that we can solve here the initial one.
In the gmfgraph model you can delete everything except one link. Map this one to the link in gmfmap. This could be of interest foru you:
They describe variuos techniques for links. Like constraints which decide which linkmapping is used if more than one mapping is using the same creation tool. It is really worth reading it.
Ralph]]>Ralph Gerbig2011-08-18T11:48:30-00:00Re: Abstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716783/#msg_716783
Thanks once again.
I have been able to come up with a basic editor as seen in attached screenshot.
My concern is that even as the link is appearing and was able to link. It is showing in RED. What could be the cause of that?
I attached the ecore, gmfgraph, gmftool and gmfmap together with screenshot
Many thanks once again.
Mark]]>Mark Ssebunnya2011-08-18T13:14:36-00:00Re: Abstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716794/#msg_716794
sending the model files does not help as the references between them are not working. Do you have it in any svn to check it out or can you attach a workspace?
Ralph]]>Ralph Gerbig2011-08-18T13:38:08-00:00Re: Abstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716800/#msg_716800
I attach the workspace zip.
Thanks once again.
Mark]]>Mark Ssebunnya2011-08-18T13:49:21-00:00Re: Abstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716813/#msg_716813
I tried out your editor and it seems to work. If I understand you right, your problem is the red square at the connection palette item. I would not bother about this and exchange it with a own custom icon as I would do for all other palette items.
Ralph]]>Ralph Gerbig2011-08-18T14:08:12-00:00Re: Abstract Class: How to handle links defined at the abstract class level
https://www.eclipse.org/forums/index.php/mv/msg/235596/716832/#msg_716832
I was thinking that red was signifying something wrong in the way the mapping are shared.
I will proceed as you advise. Thanks.