Owner property cant be set to Both whith self-referential relations

7
Why is it not possible in a meta-model to set the owner property of a reference to Both when using the reference as a self-referential(Object A to Object A) reference?
asked
3 answers
6

When you create a reference A_B between objects A and B that is owned by A, A refers to B with the name A_B (the name of the reference). If you set the Owner property of the reference to 'Both', B refers to A using this name as well.

Now consider a self-reference from A to A, A_A. This means that A refers to another A by the name A_A. If you now set the Owner property of the reference to 'Both', there would be another reference from A to A also called A_A.

As an object cannot have two references with the same name, setting the Owner property to 'Both' on self-references is not allowed.

answered
1

That's a good question, and I think about it. Let me try to illustrate it with an example. Let's say we have object A and object B and a 1-1 relation between them. That is the same as modeling a 1-0 relation from A to B and a 1-0 relation from B to A.

So you can compare a 1-1 relation with the combination of a 1-0 and a 0-1 relation. So now we can see the problem for your example. When object A has a 1-1 relation to object A then has each instance of object A two(!) references to an other object A. Because you can compare the 1-1 relation between object A and object A to a 1-0 relation from object A to object A and a 0-1 relation from object A to object A. So I hope you see, that a 1-1 relation between one object A, results in two references. And that is not what you want.

I hope this help you.

answered
0

I'm using version 2.4.3, and it is possible by me. Witch version are you using?

answered