one of the classes in an eclipse plugin model needs to reference another class in a totally different model and plugin.
To do so, I found this thread, that suggests using an edatatype and initialize its instance class with the type I need to link to. However, when I tried to link to my class in a different model, it saves the tostring of the class like in the following example
<tasks description="" id="p1.tsk4" label="1" type="place" time="10">
<requiredCapabilityDescriptor>cod.gen.impl.CapabilityDescriptorImpl@78483404 (description: , id: cap2, label: ) (parent: null)</requiredCapabilityDescriptor>
<involvedResource>cod.gen.impl.ResourceDescriptorImpl@2839ac4c (description: null, id: null, label: null) (cad: null, material: null, pointySurface: <unset>, sharpEdges: <unset>, thumbnail: null, weight: <unset>) (changeCost: null, generic: <unset>, investCost: null, manufacturer: null)</involvedResource>
</tasks>
in this example I am linking to two different external classes CapabilityDescriptorImpl and ResourceDescriptorImpl. As you can see the tostring is stored which is inconvenient in terms of storage and readability, also I am not so sure about the consistency handling in such case (I mean deleting, editing of the referenced instance). According to the thread the tostring is written because I chose the data type to be serializable, I have tried making it non serializable, but that did not work .
So I have tried another approach using an eReference, which minimised the string to save to become
<tasks description="" id="p1.tsk4" label="1" type="place" time="10">
<requiredCapabilityDescriptor xsi:type="CoD:CapabilityDescriptor" description="" id="cap2" label=""/>
<involvedResource xsi:type="CoD:ResourceDescriptor"/>
</tasks>
which is much better in terms of readability and storage, but I really doubt it is an actual reference it does not contain any thing that can refer to the original instance. Actually I am sure it is not referring to the original object as it does not show any econtainer. And again with the consistency issues.
My last option -that I can think of- is storing the URI of the referenced object but in this case I will have to manage all the consistency issues myself.
So my question is "is there a better way to achieve this external class referencing?"
Inspired by Generating an Extended EMF Model. I have done the following:
This created an xmI file that looks like
that points to another XMI file named My.des