Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

StarUML class diagram: add attribute of the type Guid[]

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.

I have not tried other modeling tools...just want to know how to do this with 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;

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

private Guid* guids; 

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#)

like image 913
kennyzx Avatar asked Oct 31 '11 03:10

kennyzx


People also ask

How do I add a return type to Operation StarUML?

Add a Parameter (Right click -> Add -> Parameter), and then change "direction" property to "return".

How do you add multiplicity to a class diagram in StarUML?

Mouseover one of the square blocks at the end of the line so you get the hand cursor and double-click. You then will see a pop-up with a combobox dropdown menu on the right side. Select the multiplicity from the dropdown menu, multiplicity can be selected from: 0..1, 1, 0.., 1.., and * or entered directly.


1 Answers

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.

Define an array with an undefined number of elements:

-guids: Guid[*]

Define an array with a specific number of elements:

-guids: Guid[16]

Define a base 0 array with an undefined number of elements:

-guids: Guid[0..*]

Define a base 1 array with an undefined number of elements:

-guids: Guid[1..*]

Define a specific base array with a specific number of elements:

-guids: Guid[1..100]
like image 168
Karl Avatar answered Sep 23 '22 02:09

Karl