0

I'm trying to represent a C++ code with an UML class diagram in the software draw.io.

Unfortunately, I didn't found a way to represent a class template.

For example, with the below code, I would like to represent a dashed rectangle containing T, at the top-right corner of the rectangle representing A.

template<class T> 
class A; 

Is it possible in draw.io and how ?

See an example here. This question already exists for Visio 2013, there.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • draw.io is a drawing tool, not an UML modeling tool. So likely you can draw anything since it has no semantics except for rendered bits. – qwerty_so Dec 23 '21 at 19:50
  • @qwerty_so There is a section named "UML" in draw.io –  Dec 24 '21 at 08:59
  • Well, Visio also has a UML section. Doesn't make it an UML tool either. My point: look for an UML modeling tool, rather than any drawing tool. I use draw.io for my simple cabling. Won't make it a PCB routing tool. It's ok for one design in a month but not for daily work. – qwerty_so Dec 24 '21 at 09:50
  • @qwerty_so yes i think your right, in the answer of the linked question, there are two free tools that can probably do that. –  Dec 24 '21 at 10:08

1 Answers1

1

As @qwerty_so mentioned, It seems like there is no shorcut in Draw.io to do that, but you can do it following this (quite annoying) way :

  • select a rectangle in the left panel (it will appears on the center),
  • move it at the top-right corner of your class,
  • in the column "Style" of the left panel, change line style to dashed line,
  • Enter the name of template in the rectangle.

This shows that it is probably better to choose UML modeling tool than drawing tool to do that. Modelio and Papyrus are free examples of them.

  • You might also look into Enterprise Architect. It's a bit weird in the UI and here and there. But it has the best price performance ratio. You get used to its weirdnesses over time. – qwerty_so Dec 24 '21 at 12:34