How do I represent an enumeration in UML, specifically using rational Rose?
tia
Printable View
How do I represent an enumeration in UML, specifically using rational Rose?
tia
I believe that it would look something similar to this:
The property-list being {Yes, No}.Code:__________________________________________
| SampleClass |
|__________________________________________|
| |
| +sampleEnum : SampleEnum = Yes {Yes, No} |
|__________________________________________|
|__________________________________________|
David
So that would be equivalent to:
would it? And defined as a member of a class? At the moment I have this (see below) but I'm not sure how it fits together in UML (my book uses Java :()Code:enum SampleEnum
{
yes,
no
};
thx for the help, much appreciated :DCode:enum SEX
{
MALE,
FEMALE
};
class Student
{
public:
//stuff
private:
//some data members +
SEX sex;
};
Just make sure that you can tell that the data type is enum but listing all the enumerations is a good ideas if they will fit. You could also attach a note icon.
The format is as follows:
<name> : <type> = <default> {<parameter list, ...>}
so...
would look similar to this:Code:enum SEX
{
MALE,
FEMALE
};
class Student
{
public:
//stuff
private:
//some data members +
SEX sex;
};
DavidCode:__________________________________
| Student |
|__________________________________|
| |
| +sex : SEX = MALE {MALE, FEMALE} |
|__________________________________|
|__________________________________|