Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XCore : opposite to several fields
XCore : opposite to several fields [message #1085937] Tue, 13 August 2013 15:08 Go to next message
Ravasz Roka is currently offline Ravasz Roka
Messages: 3
Registered: June 2013
Junior Member
Hi,

I want to describe the following

class Function {
  contains Variable[] localVariables opposite scope
  contains Variable[] inputVariables opposite scope
}

class Variable {
  String name
  container Function scope opposite ????
}



How can I specify the opposite in Variable?

Thx!
Re: XCore : opposite to several fields [message #1085950 is a reply to message #1085937] Tue, 13 August 2013 15:26 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26141
Registered: July 2009
Senior Member
Ravasz,

Opposites must be mutually paired, so the same feature can be the
opposite of at most one other feature. Consider that if you had a
Variable v and and Function f and called x.setScope(f) you won't know to
add it to localVariables or inputVariables. So editing that side makes
no sense. Instead you might define an operation that's implemented by
inspecting the eContainer of the variable and testing if it's an
instance of Function...


On 13/08/2013 5:08 PM, Ravasz Roka wrote:
> Hi,
>
> I want to describe the following
>
>
> class Function {
> contains Variable[] localVariables opposite scope
> contains Variable[] inputVariables opposite scope
> }
>
> class Variable {
> String name
> container Function scope opposite ????
> }
>
>
>
> How can I specify the opposite in Variable?
>
> Thx!
Previous Topic:How to make a class a singleton
Next Topic:EClassifier ordering in generated EPackages
Goto Forum:
  


Current Time: Sat Oct 25 15:24:03 GMT 2014

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

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