Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF] How to use container the right way
[EMF] How to use container the right way [message #1696397] Tue, 26 May 2015 09:48 Go to next message
Tobias Zangl is currently offline Tobias ZanglFriend
Messages: 15
Registered: May 2015
Junior Member
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?
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. Smile

Greetings,
Tobi
Re: [EMF] How to use container the right way [message #1696422 is a reply to message #1696397] Tue, 26 May 2015 11:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Tobias,

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 Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Teneo] problem with update site
Next Topic:[EMF Forms] Custom controls are not working
Goto Forum:
  


Current Time: Fri Apr 19 00:59:52 GMT 2024

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

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

Back to the top