Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » modeling arrays in uml
modeling arrays in uml [message #478580] Thu, 02 July 2009 16:10 Go to next message
No real name is currently offline No real nameFriend
Messages: 61
Registered: July 2009
Member
hi,

lets say I want to model that class:

class A
{
int[] age;
}

How do i do this? Is there a special element for arrays? Or is "age"
just typed integer and the upper-property is set to "*" ?

And what about multidimensional array like int[][] ?


Thanks for any help
Re: modeling arrays in uml [message #478581 is a reply to message #478580] Thu, 02 July 2009 16:18 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
You can use multiplicities for this:

class A
attribute age : int[0..*] {ordered};
end;

That means age's multiplicity will be ordered and will allow multiple
elements.

I wrote about this in the past:

http://abstratt.com/blog/2007/11/17/uml-101-with-textuml-mul tiplicity-or/

just ignore the fact that that post uses the TextUML notation.

I don't have a suggestion for the 'arrays of arrays' case other than
creating a new abstraction for it.

Cheers,

Rafael

Usul wrote:
> hi,
>
> lets say I want to model that class:
>
> class A
> {
> int[] age;
> }
>
> How do i do this? Is there a special element for arrays? Or is "age"
> just typed integer and the upper-property is set to "*" ?
>
> And what about multidimensional array like int[][] ?
>
>
> Thanks for any help
>
Re: modeling arrays in uml [message #627763 is a reply to message #478580] Thu, 02 July 2009 16:18 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
You can use multiplicities for this:

class A
attribute age : int[0..*] {ordered};
end;

That means age's multiplicity will be ordered and will allow multiple
elements.

I wrote about this in the past:

http://abstratt.com/blog/2007/11/17/uml-101-with-textuml-mul tiplicity-or/

just ignore the fact that that post uses the TextUML notation.

I don't have a suggestion for the 'arrays of arrays' case other than
creating a new abstraction for it.

Cheers,

Rafael

Usul wrote:
> hi,
>
> lets say I want to model that class:
>
> class A
> {
> int[] age;
> }
>
> How do i do this? Is there a special element for arrays? Or is "age"
> just typed integer and the upper-property is set to "*" ?
>
> And what about multidimensional array like int[][] ?
>
>
> Thanks for any help
>
Previous Topic:modeling arrays in uml
Next Topic:Re: The definitive truth about multiple inheritance
Goto Forum:
  


Current Time: Thu Mar 28 09:02:45 GMT 2024

Powered by FUDForum. Page generated in 0.03288 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top