Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[EMF] How to use container the right way
https://www.eclipse.org/forums/index.php/mv/msg/1066868/1696397/#msg_1696397
if i have something like a Helper class and different subclasses like SpecificHelper1, SpecificHelper2..
Now my class A has one reference to one of the helper class instances. But the same instance from for example SpecificHelper1 can belong to many instances of class A.
This means that class A cannot be a container for the Helper class right?
But which class would contain my Helper class instances? (and i think they need a container or otherwise they are not stored in EMF-Store)
My current approach was to create a specific HelperClassList which contains all the helper instances, but if i click the Create-And-Link button of class A then my newly generated helper class is not contained in the HelperClassList but instead in the root model (which is obvious of course). Is there any possibility to change the behaviour of the Create-And-Link button without creating a new view model control so the user doesnt have to move the helper instance himself in the HelperClassList?
Or is there any way to not show instances of a class in the model view tree?
Or is there any better approach than using this HelperClassList as container for the helper classes?
Are ReferenceServices useful in this scenario? (and by the way do you have any tutorial, example for a reference service implementation?)
Thanks for any advice.
Greetings,
Tobi]]>Tobias Zangl2015-05-26T09:48:09-00:00Re: [EMF] How to use container the right way
https://www.eclipse.org/forums/index.php/mv/msg/1066868/1696422/#msg_1696422
Comments below.
On 26/05/2015 11:48 AM, Tobias Zangl wrote:
> Hey,
>
> if i have something like a Helper class and different subclasses like
> SpecificHelper1, SpecificHelper2..
>
> Now my class A has one reference to one of the helper class instances.
> But the same instance from for example SpecificHelper1 can belong to
> many instances of class A.
> This means that class A cannot be a container for the Helper class right?
Yes, containment is exclusive. An instance can be a member of at most
one containment reference.
> But which class would contain my Helper class instances? (and i think
> they need a container or otherwise they are not stored in EMF-Store)
Yes, a reference must have a container or be directly contained by a
resource to be serialized, i.e., EObject.eResource() must not be null.
>
> My current approach was to create a specific HelperClassList which
> contains all the helper instances, but if i click the Create-And-Link
> button of class A then my newly generated helper class is not
> contained in the HelperClassList but instead in the root model (which
> is obvious of course). Is there any possibility to change the
> behaviour of the Create-And-Link button without creating a new view
> model control so the user doesnt have to move the helper instance
> himself in the HelperClassList?
That's more a question about EMF Forms?
> Or is there any way to not show instances of a class in the model view
> tree?
>
> Or is there any better approach than using this HelperClassList as
> container for the helper classes?
>
> Are ReferenceServices useful in this scenario? (and by the way do you
> have any tutorial, example for a reference service implementation?)
>
> Thanks for any advice. :)
>
Hopefully the EMF Forms/Store guys will notice your question is directed
at them.
> Greetings,
> Tobi]]>Ed Merks2015-05-26T11:50:46-00:00