Attribute link with association class?

0 votes
asked Oct 19, 2018 in Question / help by PaulRein


As per the answer to the question about links to class members, you can use 

Foo::field1 --> Bar::field3 : foo

to make associations between fields of a class. This works great. However, I now had reason to want an association-class with such a link (I might be abusing UML/PlantUML now)  but the documented way with parenthesis does not work with such links.

As a minimal non-working example I modified the association class example from the documentation:

class Student {
Student::Name "0..*" - "1..*" Course
(Student::Name, Course) .. Enrollment

class Enrollment {

The link itself works as expected (if I comment out the next line) but the attempt at an association class is a syntax error. I tried to put quotes around the offending part but that did not help.

(Note that I am fully aware that, in this example, it makes no semantic sense to want a link between a Student::Name and a Course. As I said, I just tweaked the example from the manual as a minimal demonstration of the issue)

Can this be made to work ?

commented Oct 24, 2018 by mgrol (2,800 points)
I know you asked to link  Student::Name and Course. If you remove the ::Name and link classes Student and Course, this would work.
Please see here:

commented Nov 29, 2018 by mgrol (2,800 points)

did this help even if this was not exactly the answer you where asking for? I would be appreciated if you could give a short feedback. Thank you in advance.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.