explicite bidirectional containment references [message #428955] |
Sat, 04 April 2009 14:43 |
|
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 #428958 is a reply to message #428956] |
Sat, 04 April 2009 20:05 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03155 seconds