如何在plantuml中编写typedef和别名 [英] How to write typedef and alias in plantuml

查看:644
本文介绍了如何在plantuml中编写typedef和别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我的cpp实现如下所示:

For example my cpp implementation looks like:

class B {
  int value;
}

typedef MyB B;

class A {
  MyB b;
}

我的植物代码:

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

如何在plantuml中表示此别名.应该如何正确地做到这一点.我在plantuml教程中找不到此内容.

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

推荐答案

在UML规范中,别名仅与导入一起使用(尽管别名也可以在名称空间中使用).第30页提供了一个示例,该示例还解决了您使用typedef的第二个问题:

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:

在图7.8中,ElementImport与别名结合在一起,这意味着DataType Types :: Real将在Shapes包中被命名为Double.

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.

我不知道plantUML,但是如果它符合UML(应该是UML),那么您可以如上所述进行操作.

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

这篇关于如何在plantuml中编写typedef和别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆