StarUML类图:添加Guid []类型的属性 [英] StarUML class diagram: add attribute of the type Guid[]

查看:128
本文介绍了StarUML类图:添加Guid []类型的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在StarUML 5.0中,我试图定义一个类型为Guid [](Guid Structure的数组)类型的属性的类。但是不允许输入 -guids:Guid [],因为StarUML会自动丢弃方括号。

In StarUML 5.0, I am trying to define a class with an attribute of the type Guid[] (an array of Guid Structure). But it is not allowable to enter "-guids : Guid[]" since StarUML automatically discards the square brackets.

我还没有尝试过其他建模工具...只是想知道如何使用StarUML。

I have not tried other modeling tools...just want to know how to do this with StarUML.

如果我提供数组的长度,StarUML似乎可以接受,例如 -guids:Guid [10],但是在StarUML生成的代码中,该字段类似于

StarUML seems to accepts if I provide the length of the array, like "-guids : Guid[10], but in the code generated by StarUML, this field is something like

private Guid guids; //the square brackets are missing;

或者我可以在生成的代码中添加一个 -guids:Guid *之类的星号,该字段如下:

Or I can add an asterisk like "-guids : Guid*", in the code generated, the field is like this

private Guid* guids; 

这不是我所不需要的,即使在C ++中指针和数组在概念上是可以互换的(我用C#编码)

this is not what i want neither, even with the fact that in C++ a pointer and an array is conceptually interchangeable. (I am coding in C#)

推荐答案

StarUML定义的数组与标准UML有点不同对于您的特定问题,我将使用[*]定义数组。下面的第一个示例对此进行了说明。

StarUML defines arrays a little differently to standard UML. For your specific problem I would use [*] to define the array. The first example below describes this.

定义一个未定义元素数的数组:

-guids: Guid[*]

定义具有特定数量元素的数组:

-guids: Guid[16]

定义基数为0且未定义数字的数组元素的数量:

-guids: Guid[0..*]

定义一个基数为1且元素数量不确定的数组:

-guids: Guid[1..*]

定义具有特定数量元素的特定基本数组:

-guids: Guid[1..100]

这篇关于StarUML类图:添加Guid []类型的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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