Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » explicite bidirectional containment references
explicite bidirectional containment references [message #428955] Sat, 04 April 2009 14:43 Go to next message
Jorge Dieguez is currently offline Jorge Dieguez
Messages: 48
Registered: July 2009
Location: France
Member

Hello forum,

I have tried what I think should be the annotation for an explicite
bidirectional containment reference. annotation bellow:

public interface AObj {
/**
* @model kind="reference" opposite="referenceA" containment="true"
*/
BObj getReferenceB();
}
conversely:
public interface BObj {
/**
* @model kind="reference" opposite="referenceB" required="true"
*/
AObj getReferenceA();
}

Though both references correctly display in .genmodel and ecore;
referenceA's label(referenceA) does not display at the other end of
"referenceB" link in ecore_diagram. i.e. ecore_diagram just displays one
diamonded link labelled referenceB and contained in AObj.

Many thanks for your help,

Jorge

Is this due to the fact that


Jorge
Re: explicite bidirectional containment references [message #428956 is a reply to message #428955] Sat, 04 April 2009 16:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Jorge,

Comments below.

Jorge Dieguez wrote:
> Hello forum,
>
> I have tried what I think should be the annotation for an explicite
> bidirectional containment reference.
There's a refcard now and when complete confounded, create it directly
in Ecore, generate it from scratch, and look at those annotations...
> annotation bellow:
>
> public interface AObj {
> /**
> * @model kind="reference" opposite="referenceA" containment="true"
> */
> BObj getReferenceB();
> }
> conversely:
> public interface BObj {
> /**
> * @model kind="reference" opposite="referenceB" required="true"
> */
> AObj getReferenceA();
> }
>
> Though both references correctly display in .genmodel and ecore;
> referenceA's label(referenceA) does not display at the other end of
> "referenceB" link in ecore_diagram. i.e. ecore_diagram just displays
> one diamonded link labelled referenceB and contained in AObj.
So you're saying the underlying Ecore model correct, i.e., are the
opposites set on both ends?

It sounds like you're using the example Ecore editor from GMF instead of
the specialized one provided by Ecore Tools because the former used
ecore_diagram and the later uses ecorediag. I'd recommend that later
for serious development purposes.
>
> Many thanks for your help,
>
> Jorge
> Is this due to the fact that
Re: explicite bidirectional containment references [message #428958 is a reply to message #428956] Sat, 04 April 2009 20:05 Go to previous message
Jorge Dieguez is currently offline Jorge Dieguez
Messages: 48
Registered: July 2009
Location: France
Member

Ed, Many thanks for the pointer to the refcard, I will follow up...

Further information bellow:

Ed Merks wrote:
...

>> I have tried what I think should be the annotation for an explicite
>> bidirectional containment reference.
> There's a refcard now and when complete confounded, create it directly
> in Ecore, generate it from scratch, and look at those annotations...

>> annotation bellow:
>>
>> public interface AObj {
>> /**
>> * @model kind="reference" opposite="referenceA" containment="true"
>> */
>> BObj getReferenceB();
>> }
>> conversely:
>> public interface BObj {
>> /**
>> * @model kind="reference" opposite="referenceB" required="true"
>> */
>> AObj getReferenceA();
>> }
>>
>> Though both references correctly display in .genmodel and ecore;
>> referenceA's label(referenceA) does not display at the other end of
>> "referenceB" link in ecore_diagram. i.e. ecore_diagram just displays
>> one diamonded link labelled referenceB and contained in AObj.
> So you're saying the underlying Ecore model correct, i.e., are the
> opposites set on both ends?

Yes, it looks Ok in .ecore, .genmodel (both ends are represented in the
association and, accessor methods are generated and implemented in the
interface and ...Impl packages.

> It sounds like you're using the example Ecore editor from GMF instead of
> the specialized one provided by Ecore Tools because the former used
> ecore_diagram and the later uses ecorediag. I'd recommend that later
> for serious development purposes.

I guess I'm using the former since -as you notice is .ecore_diagram
(.ecore submenu->Initialize ecore_diagram diagram file). I have check
other post for the ecorediag and it seems I should download it.

Many thanks for your help.

Jorge
>>
>> Many thanks for your help,
>>
>> Jorge
>> Is this due to the fact that


Jorge
Previous Topic:getCanGenerateParent() in the Generator Extension Example
Next Topic:Teneo: Backward Compatibility of latest build, some new features
Goto Forum:
  


Current Time: Sat Sep 20 08:15:53 GMT 2014

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

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