Welcome to PlantUML Q&A, where you can ask questions and receive answers from other members of the community.

You can also submit new features request and vote for them.

Does PlantUML support references between class/component members

0 votes

I want to link members of class or components.
Here is an example:

@startuml
object user
user : id
user : name
user : email
 
object project {
id
name
description
user_id
}
 
' And now I try to link directly the members
project.user_id -> user.id
@enduml
 
The DOT syntax itself allows something like this:
See: http://www.graphviz.org/doc/info/shapes.html Chapter Record-based nodes.
 
Does PlantUML support something similar? 
 
asked Jul 14, 2015 by anonymous

2 Answers

0 votes
Hi,

Thank for the suggestion. However, PlantUML does not support this (yet).

The closest feature you can have is note attached to specific method/attribut of a class (see http://plantuml.sourceforge.net/qa/?qa=3474/attach-note-to-specific-method-attribut-of-a-class ).

We can allow notes for object attribut if you need it.

Using record-bases nodes of Graphviz to link class members is theorically possible. But this is not an easy move so we have to postpone it somehow. Sorry about that!

Regards,
answered Jul 15, 2015 by plantuml (124,290 points)
Thanks for the fast answer.
Luckily PlantUML is still awesome enough.
Great work so long.
0 votes

With last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can now have:

@startuml
class Foo {
+ field1
+ field2
}

class Bar {
+ field3
+ field4
}

Foo::field1 --> Bar::field3 : foo
Foo::field2 --> Bar::field4 : bar
@enduml


Note that this is still a beta version, so it may not work/crash in some case.
Feedback welcome!

answered Jun 29, 2016 by plantuml (124,290 points)
Sorry for the really late response.

But finally: Works great :)
Would like to have it inside an official release.

Thanks a lot for the work!
Support This Project Offer 250 Mo! Follow PlantUML on Twitter
...