Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Containment and eOpposite
icon5.gif  Containment and eOpposite [message #1065197] Mon, 24 June 2013 18:21 Go to next message
tony hedoux is currently offline tony hedouxFriend
Messages: 19
Registered: May 2012
Junior Member
Hi,

I have a really simple model :
Block class, which have two list of Ports objects : inPortsList and outPortsList. These are containement references.
Port class, which ave only one reference, "parent", of type Block.

The rules I would like to set are :
1 - A port can be in inPortsList XOR in outPortsList.
2 - parent is opposite references to current block.

I have no difficulties to set two containments from Block to Port, but I'm unable to set a dual eOpposite.

Metamodel is in attachment.

Someone can explain me why?

Thx for help

Tony

  • Attachment: test.ecore
    (Size: 0.84KB, Downloaded 18 times)
Re: Containment and eOpposite [message #1065211 is a reply to message #1065197] Mon, 24 June 2013 19:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26217
Registered: July 2009
Senior Member
Tony,

Comments below.

On 24/06/2013 8:21 PM, tony hedoux wrote:
> Hi,
>
> I have a really simple model :
> Block class, which have two list of Ports objects : inPortsList and outPortsList. These are containement references.
Hmm...
> Port class, which ave only one reference, "parent", of type Block.
>
> The rules I would like to set are :
> 1 - A port can be in inPortsList XOR in outPortsList.
> 2 - parent is opposite references to current block.
>
> I have no difficulties to set two containments from Block to Port, but I'm unable to set a dual eOpposite.
Opposites must be paired. You can't have a single feature Port.block
that's shared by two different Block.inPortList and Block.outPortList
>
> Metamodel is in attachment.
>
> Someone can explain me why?
You can define an EOperation port.getBlock that's derived from
EObject.eContainer...
>
> Thx for help
>
> Tony
>
>
Re: Containment and eOpposite [message #1065220 is a reply to message #1065211] Mon, 24 June 2013 20:16 Go to previous message
tony hedoux is currently offline tony hedouxFriend
Messages: 19
Registered: May 2012
Junior Member
Thx for this precisions Ed!
Previous Topic:Empty tags
Next Topic:[Teneo] using C3P0: $Proxy10 cannot be cast to oracle.sql.CLOB
Goto Forum:
  


Current Time: Tue Nov 25 01:56:03 GMT 2014

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

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