Two classes with a same name in PlantUML class diagram
Asked Answered
I

1

6

Dear community members and PlantUml practitioners,

I would like to have two classes with the same name such as:

  • Test << stereotype >>
  • Test

and I would like to make relation between those two classes. Is it possible to make alias for classes in class diagram so I can make distinction between the classes thus those will be represented as two different elements.

Any idea?

Intercalate answered 23/8, 2018 at 7:11 Comment(1)
hm I dont know PlantUml but you can not have classes with same name because if you will generate source code it end with error. But you can have same classes in different namespaces.Bonneau
B
12

With plantuml you can alias a display name using "as." For class diagrams it looks Like this:

@startuml
class "Test" as t1
class "Test" as t2
t1 -> t2
@enduml

As rendered by the online planuml server at http://www.plantuml.com

Binary answered 24/8, 2018 at 14:50 Comment(2)
see also: forum.plantuml.net/8111/…Monarchist
Thanks I lot John and I apologize for the lag of my response. I was thinking that I tried the aliases in this context but it was obvious that I didn't. Thanks a lot for the provided solution to my problem.Intercalate

© 2022 - 2024 — McMap. All rights reserved.