2

I noticed how the association class was automatically created simultanously when the classes which the association class depends on were added. That is of course how it should be. The problem with that, however, is that I'd normally go about like this when adding things like integers in the "new debugger":

action: 
Class.allinstances->at0(0) .attribute:=number

But since the this class isn't of a multiciply and solely created because of its connections to the other created classes, the at0 operator does not work.

How should I go about instead? And generally, what should you look out for when programing in MDriven's "new debugger" for association classes?

1 Answers1

2

enter image description here

Once you have association classes you must be aware of following:

  1. The object for LinkClass is created and deleted as a consequence of adding a Class2 object to Class2's association or a Class1 object to Class1's association.

  2. To access the LinkClass object you use the LinkRoleName association and to move from the LinkClass back to Class1 or Class2 you use the InnerLinkName association. Both LinkRoleName and InnerLinkName are settable in the object inspector for association-ends. They will have default names if not defined.

Hans Karlsen
  • 2,275
  • 1
  • 15
  • 15
  • Could you give an example on how the code would look if I wanted to set an integer to an attribute possessed by the LinkClass, like the code I wrote above? Thanks. – Joe Andersson Feb 14 '18 at 16:15