same class at different level

0 votes
asked Sep 12, 2017 in To be sorted by nikhil (520 points)

classA --> classB

classD --> classB

gives me -

 

What I need is -

ClassA --> ClassB

and ClassA --> ClassB

where single classB is not connected to A and B.

 

1 Answer

0 votes
answered Sep 12, 2017 by Serge Wenger Work (15,620 points)
commented Sep 13, 2017 by nikhil (520 points)
Yes. I am expecting the same.
But, I do not want to use alias. Something like-

class classA
class classB
class classD
class myClassB as "classB"

classA --> classB
classD --> myClassB

http://www.plantuml.com/plantuml/png/Iyv9B2vMI0QHZbp928uJCiS5oicjT0RBAIGMAoX1b2bnGUGS5NHrxL2qke15O5e0

will give me above diagram. But I am looking for some other solution as in my case there are many numbers of classes with same name which I have to display on diagram.

Thanks.
commented Sep 13, 2017 by Serge Wenger Work (15,620 points)
Hello,

For me it is really simpler to always use alias. A class cannot be twice with the same namespace. You could add the namepace like this with the same diagram:
@startuml
class "classA"  as ::ClassA
class "classB"  as a::ClassB
class "classB"  as b::ClassB
class "classD"  as ::ClassD
::ClassA --> a::ClassB

::ClassD --> b::ClassB
@enduml
...