在 PlantUML 图中混合类和用例

Mar*_*ing 2 plantuml

我尝试创建一个包含类层次结构以及使用这些类的用例的图表。我今天尝试使用 PlantUML,但不知何故无法混合这两种图表类型。这是我能想到的最简单的文件:

\n
@startuml\nclass Foo\nusecase Bar\n@enduml\n
Run Code Online (Sandbox Code Playgroud)\n

当我只有其中一行时,它工作得很好。但通过这两行我得到了这个:

\n
\xe2\x9d\xaf plantuml text.txt\nError line 5 in file: text.txt\nSome diagram description contains errors\n
Run Code Online (Sandbox Code Playgroud)\n

有没有办法将两者都放入图表中,或者这是不可能的?

\n

Mar*_*ing 5

我使用过 PlantUML 1.2021.0。这显然不包含allowmixing当前版本 1.2021.14 支持的功能。升级软件并添加allowmixing到文件可以解决此问题。

@startuml
allowmixing
class Foo
usecase Bar
@enduml
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述