4

How to define attribute (in class diagram)as an array of four elements using Papyrus as a modelling environment?

Does that possible in Papyrus?

Here is the class:

enter image description here

How to edit the properties of attribute in the following properties view to represent an array of four elements??

enter image description here

Community
  • 1
  • 1
user2019510
  • 1,460
  • 5
  • 16
  • 29
  • I haven't work with this application, but try `String[]`, and as I know usually the size of the arrays is not initialized with its declaration, but you would do it so with initializing(default value/sequence diagram), like `+names:String[] = new String[4]` –  Oct 13 '13 at 17:28

2 Answers2

1

I haven't used Papyrus specifically but you have a field called Multiplicity on the right. Change it to 4 if your array has to always have exactly 4 elements or 0..4 if it can have at most 4 elements.

Ister
  • 5,958
  • 17
  • 26
0

It is much, much more easy.

enter image description here

If these elements belong ONLY here, use composition - filled diamond. If they can exist by themselves, use Aggregation - empty diamond.

Gangnus
  • 24,044
  • 16
  • 90
  • 149
  • thanks @Gangnus What if the array consists of four integer numbers ? – Carlos Mar 07 '14 at 20:10
  • You will simply put intStaticArray into body of ClassicWorkDesk block. The line will be int[1..4]:intStaticArray. If you will set it as static in any modeller, it will be underlined. If you use more simple tool, underline by hand. – Gangnus Mar 07 '14 at 22:24