[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Links for references?


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@xxxxxxxxxxx> 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@xxxxxxxxx> wrote in message news:ep8h66$72u$1@xxxxxxxxxxxxxxxxxxxx

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?