left direction ignored when pointing from inside a namespace to sub namespace

0 votes
asked Dec 28, 2019 in Bug by etam (120 points)
Example:

@startuml

namespace ns1 {
  class A
  namespace ns2 {
    class B
  }
}
ns1.A -left- ns1.ns2.B

class C
namespace ns3 {
  class D
}
C -left- ns3.D

@enduml

Result: http://www.plantuml.com/plantuml/png/SoWkIImgAStDuUBAIynDBIv8J4vLo2isLAZcKb18paaiBbPm1BAGvOp0SZ1P9o2xbgkM2wX7pr51DoSrhKHN0SG1AjHpukA2g796CTqOoNGNe5vdX3vZFHSkBeVKl1IWam00

Expected result: class B should be left from A, just like D is left from C.

Using packages instead of namespaces doesn't help.

1 Answer

0 votes
answered May 23 by The-Lu (9,220 points)

Hello E.,

Using packages instead of namespaces doesn't help.

No, using packages can help, but we lost the power of namespace...

As workaround, we can combine 'package' and 'together' (for only one element!) as it:

package ns1 {
  together {
    class A
  }
  namespace ns2 {
    class B
  }
}
A -left- ns2.B

Then we observe the expected result:

Expected result: class B should be left from A, just like D is left from C.


[Click to the image to see on PlantUML server]

See also 'together':

If that can help,
Regards,
Th.

...