Hi,
I started to play with slots and I am observing odd behaviour after the class structure gets changed. I am having classes: Object subclass: #CTA slots: { #x. #b => ToManyRelationSlot inverse: #a inClass: #CTB } classVariables: { } category: ‘ClassTest' and Object subclass: #CTB slots: { #x. #a => ToOneRelationSlot inverse: #b inClass: #CTA } classVariables: { } category: ‘ClassTest' then I create instance of CTA and CTB pointing to CTA: a1 := CTA new x: 1; yourself. b1 := CTB new x: 1; a: a1; yourself. the a1 is updated as expected with b having RelationSet with my CTB instance. The problem is when I decided to update the class CTA - changing position of slot #b => ToManyRelationSlot inverse: #a inClass: #CTB. In the case I drop all the instances of CTA and CTB and recreate new by code above, the inverse update always addresses slot on same position as before and not the one with right name. For example when I change it like : Object subclass: #CTA slots: { #x. #children => ToManyRelationSlot inverse: #parent inClass: #CTA. #b => ToManyRelationSlot inverse: #a inClass: #CTB. #parent => ToOneRelationSlot inverse: #children inClass: #CTA } classVariables: { } category: ‘ClassTest' the result of the code a1 := CTA new x: 1; yourself. b1 := CTB new x: 1; a: a1; yourself. is that slot children gets updated having RelationSet with my CTB instance instead of slot b which has empty RelationSet. The question is: Am I doing something wrong ? Is there any way how to tell class to reinit slots as its order has changed ? Thanks, Jan |
Hi,
I investigated a little bit more and I see that CTA slots are as expected - slot b has index 3: while CTB slots have inverse slot for a with old index 2 - so the inverse part was not updated when I changed CTA structure Thanks for any advice, Jan
|
In reply to this post by Jan Čada-2
Hi. 2016-09-28 15:36 GMT+02:00 Jan Cada <[hidden email]>:
|
Hi,
I have opened the issue #19153. Thanks, Jan
|
|
Free forum by Nabble | Edit this page |