|Re: [EMF] How to use container the right way [message #1696422 is a reply to message #1696397]
||Tue, 26 May 2015 11:50
| Ed Merks
Registered: July 2009
On 26/05/2015 11:48 AM, Tobias Zangl wrote:
> 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
> 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
Powered by FUDForum
. Page generated in 0.01932 seconds