Skip to main content


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 RokaFriend
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 MerksFriend
Messages: 33141
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!


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How to make a class a singleton
Next Topic:EClassifier ordering in generated EPackages
Goto Forum:
  


Current Time: Thu Apr 25 17:36:24 GMT 2024

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

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

Back to the top