views:

414

answers:

2

I know it is possible to specify the multiplicity within the same class box, without having to draw the link to another class.

My question is, Where should the multiplicity go, after the name or after the type?

Is it:

visibility name multiplicity : type

as

+ clients [0..n] : Client

or

visibility name : type multiplicity

as

+ clients : Client [0..n]

I have two books (Applitying UML and Patterns by Larman and UML and the Unified process by Arlow and Newstadt ) but they differ

+1  A: 

UML syntax is a diagrammatic syntax. See this multiplicity example from

http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/

Figure 6: An example of a bi-directional association between a Flight class and a Plane class

 -----------------                   -----------------
 | Flight        |0..*         0..1  |  Plane        |
 |               | ------------------|               |
 |----------------                   -----------------
Larry Watanabe
I meant in class diagram
OscarRyz
not sure I understand your question - please clarify
Larry Watanabe
@Larry: Yeap, my question was not clear. I have update it.
OscarRyz
+1  A: 

Pulled from printed page 107 of the UML 2.2 Superstructure OMG Specificiation

Example ...

+createWindow (location: Coordinates, container: Container [0..1]): Window

MORE Examples from the multiplicity element spec, on printed page 97.

Example from Spec on multiplicity.

|--------------------------------------------|
|                Customer                    |
|--------------------------------------------|
| purchase : Purchase [*] {ordered, unique}  |
| account: Account [0..5] {unique}           |
|                                            |
|--------------------------------------------|
Ted Johnson
That's the kind of reference I was looking for. Thank you.
OscarRyz