Dear all, it seems that there are different ways to use qualified names (which are not well documented, unless I am mistaken). In the following simple example. I like to declare an association between the classes A and B which are in the packages p1 and p2, respectively.
PlantUML can create a duplicate of a referenced classifier, since it interprets a qualified name as a relative path unless it is prefixed with a dot or the first segment of the qualified name is already known. See below for an example. Is there a preference to use qualified names?
@startuml ' does not work: p2 is interpreted as subpackage of p1, B is duplicated package p1 { class A { } A -- p2.B } package p2 { class B { } } @enduml |
@startuml ' forward declaration of p2, works package p2 {} package p1 { class A { } A -- p2.B } package p2 { class B { } } @enduml |
@startuml ' absolute qualified names using a preceding dot package p1 { class A { } A -- .p2.B } package p2 { class B { } } @enduml |
@startuml ' enclosing with single root, works package root { package p1 { class A { } A -- root.p2.B } package p2 { class B { } } } @enduml |