How to write typedef and alias in plantuml

感情迁移 提交于 2019-12-08 07:33:45

问题


For example my cpp implementation looks like:

class B {
  int value;
}

typedef MyB B;

class A {
  MyB b;
}

My plantuml code:

class B {
  int value;
}
class A {
  MyB b;
}
A o-- B

How to represent this alias in plantuml. How it should be done in right way. I can't find this in plantuml tutorial.


回答1:


Aliases are merely referred to in the UML specs along with imports (though aliases may be used in namespaces as well). P. 30 gives an example which also addresses your 2nd issue with typedef:

In Figure 7.8, the ElementImport is combined with aliasing, meaning that the DataType Types::Real will be referred to by name as Double in the package Shapes.

I don't know plantUML but if it is UML compliant (which it should be) then you can do as described above.



来源:https://stackoverflow.com/questions/46718471/how-to-write-typedef-and-alias-in-plantuml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!