Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Links for references?
Links for references? [message #96308] Wed, 24 January 2007 15:56 Go to next message
Eclipse UserFriend
Apologize is this has been addressed already but I couldn't find anything.

I'd like to support links for refernces between nodes without having an
explicit domain object cooresponding to the link. For example, imagine
the State model without the transition (this of course assumes that you
don't have a many-to-many relation or have actual transition state you
care about).

I've managed to support the creation of the link by overiding
*TypeLinkCreateCommand.doElementCreation, [with support for doUndo and
doRedo), ignoring the super object and simply adding the references to
the source and target node objects.

But am now having lot's of second thoughts about wheree to go from
here. For example, all of the edit pieces are generated for whatever my
"imaginary" Link doman element is. I'm not even sure how one would
manage delting the domain element. When I do an undo, it works fine,
but after a save, if I try to try that the diagram is deleted (!!) with
no error reported. etc..

So not asking to solve all of these problems for me ;) but I'm really
wondering wether this is even a reasonable thing to do?
Re: Links for references? [message #96796 is a reply to message #96308] Thu, 25 January 2007 09:36 Go to previous messageGo to next message
Eclipse UserFriend
Hi Miles,

Reference-based links are supported. Just leave the Domain Model Element
empty for the link mapping and specify the correct Link Meta Feature (leave
all other features blank).
The code will be generated for reference-based link without an underlying
model element.

Best regards,
Boris Blajer


"Miles Parker" <milesparker@gmail.com> wrote in message
news:ep8h66$72u$1@utils.eclipse.org...
>
> Apologize is this has been addressed already but I couldn't find anything.
>
> I'd like to support links for refernces between nodes without having an
> explicit domain object cooresponding to the link. For example, imagine the
> State model without the transition (this of course assumes that you don't
> have a many-to-many relation or have actual transition state you care
> about).
>
> I've managed to support the creation of the link by overiding
> *TypeLinkCreateCommand.doElementCreation, [with support for doUndo and
> doRedo), ignoring the super object and simply adding the references to the
> source and target node objects.
>
> But am now having lot's of second thoughts about wheree to go from here.
> For example, all of the edit pieces are generated for whatever my
> "imaginary" Link doman element is. I'm not even sure how one would manage
> delting the domain element. When I do an undo, it works fine, but after a
> save, if I try to try that the diagram is deleted (!!) with no error
> reported. etc..
>
> So not asking to solve all of these problems for me ;) but I'm really
> wondering wether this is even a reasonable thing to do?
>
Re: Links for references? [message #96838 is a reply to message #96796] Thu, 25 January 2007 10:29 Go to previous message
Eclipse UserFriend
Excellent, that worked perfectly!

That was actually the very first thing I tried, but I couldn't get the
model to validate. (Diagnosis of Mapping Link mapping without 'Domain
Element' class does not use 'Containment Feature' and 'Source
Feature'). The secret was "(leave all other features blank)" -- I had
been specifying both the source meta feature and its target opposite.
Of course, EMF handles the bi-direcitonal link automatically.



On 2007-01-25 09:36:42 -0500, "Boris Blajer" <boris.blajer@borland.com> said:

> Hi Miles,
>
> Reference-based links are supported. Just leave the Domain Model
> Element empty for the link mapping and specify the correct Link Meta
> Feature (leave all other features blank).
> The code will be generated for reference-based link without an
> underlying model element.
>
> Best regards,
> Boris Blajer
>
>
> "Miles Parker" <milesparker@gmail.com> wrote in message
> news:ep8h66$72u$1@utils.eclipse.org...
>>
>> Apologize is this has been addressed already but I couldn't find anything.
>>
>> I'd like to support links for refernces between nodes without having an
>> explicit domain object cooresponding to the link. For example, imagine
>> the State model without the transition (this of course assumes that you
>> don't have a many-to-many relation or have actual transition state you
>> care about).
>>
>> I've managed to support the creation of the link by overiding
>> *TypeLinkCreateCommand.doElementCreation, [with support for doUndo and
>> doRedo), ignoring the super object and simply adding the references to
>> the source and target node objects.
>>
>> But am now having lot's of second thoughts about wheree to go from
>> here. For example, all of the edit pieces are generated for whatever my
>> "imaginary" Link doman element is. I'm not even sure how one would
>> manage delting the domain element. When I do an undo, it works fine,
>> but after a save, if I try to try that the diagram is deleted (!!) with
>> no error reported. etc..
>>
>> So not asking to solve all of these problems for me ;) but I'm really
>> wondering wether this is even a reasonable thing to do?
Previous Topic:Nested Rectangles and Layout
Next Topic:Setting Label position relative to another figure
Goto Forum:
  


Current Time: Fri May 09 03:47:20 EDT 2025

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

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

Back to the top