How to define enumeration in uml object diagram -


how can define enumeration in object diagram?

+---------------------+ |   <<enumeration>>   | |    :dayoftheweek    | |    ¯¯¯¯¯¯¯¯¯¯¯¯¯    | |_____________________| | sunday              | | monday              | | tuesday             | | ...                 | +---------------------+ 

or that:

+---------------------------+ |      <<enumeration>>      | |    sunday:dayoftheweek    | |    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯    | |___________________________| |                           | +---------------------------+  +---------------------------+ |      <<enumeration>>      | |    monday:dayoftheweek    | |    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯    | |___________________________| |                           | +---------------------------+ 

i think it's possible create 1 instance of enumeration object, right?

an enumeration data type has predefined enumeration literals, such sunday, monday, , tuesday. every predefined enumeration literal already instance of enumeration!

you can use enumeration literal property value in other object instance. example, might see slot dayofweek = sunday inside object instance of type calendarevent, assuming calendarevent type defines dayofweek property of type dayoftheweek.

btw, class diagram can show both classes , instances. don't think there such thing "instance diagram" in uml 2, colloquial name instances on class diagram.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -