Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Abstract Class: How to handle links defined at the abstract class level(Abstract (Parent) class and how to handle is links with several Concrete(Child) classes defined)
Abstract Class: How to handle links defined at the abstract class level [message #716706] Thu, 18 August 2011 07:31 Go to next message
Mark Ssebunnya is currently offline Mark SsebunnyaFriend
Messages: 5
Registered: August 2011
Junior Member
Hello,

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.
Re: Abstract Class: How to handle links defined at the abstract class level [message #716709 is a reply to message #716706] Thu, 18 August 2011 07:40 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

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
Re: Abstract Class: How to handle links defined at the abstract class level [message #716758 is a reply to message #716709] Thu, 18 August 2011 10:57 Go to previous messageGo to next message
Mark Ssebunnya is currently offline Mark SsebunnyaFriend
Messages: 5
Registered: August 2011
Junior Member
Hi Ralph

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
  • Attachment: FAMEditor.jpg
    (Size: 181.98KB, Downloaded 222 times)
  • Attachment: FAMED6.ecore
    (Size: 5.12KB, Downloaded 270 times)
Re: Abstract Class: How to handle links defined at the abstract class level [message #716768 is a reply to message #716758] Thu, 18 August 2011 11:48 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

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:

http://wiki.eclipse.org/Graphical_Modeling_Framework/Tutorial/Part_2

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
Re: Abstract Class: How to handle links defined at the abstract class level [message #716783 is a reply to message #716758] Thu, 18 August 2011 13:14 Go to previous messageGo to next message
Mark Ssebunnya is currently offline Mark SsebunnyaFriend
Messages: 5
Registered: August 2011
Junior Member
Hi Ralph,
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
Re: Abstract Class: How to handle links defined at the abstract class level [message #716794 is a reply to message #716783] Thu, 18 August 2011 13:38 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

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
Re: Abstract Class: How to handle links defined at the abstract class level [message #716800 is a reply to message #716794] Thu, 18 August 2011 13:49 Go to previous messageGo to next message
Mark Ssebunnya is currently offline Mark SsebunnyaFriend
Messages: 5
Registered: August 2011
Junior Member
Hi Ralph,

I attach the workspace zip.
Thanks once again.

Mark
  • Attachment: workspace.zip
    (Size: 376.16KB, Downloaded 253 times)
Re: Abstract Class: How to handle links defined at the abstract class level [message #716813 is a reply to message #716800] Thu, 18 August 2011 14:08 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

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
Re: Abstract Class: How to handle links defined at the abstract class level [message #716832 is a reply to message #716813] Thu, 18 August 2011 14:37 Go to previous message
Mark Ssebunnya is currently offline Mark SsebunnyaFriend
Messages: 5
Registered: August 2011
Junior Member
Hi Ralph,
I was thinking that red was signifying something wrong in the way the mapping are shared.
I will proceed as you advise. Thanks.

Mark
Previous Topic:Block resize an element
Next Topic:multiple editors for packages
Goto Forum:
  


Current Time: Fri Apr 19 03:47:35 GMT 2024

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

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

Back to the top