GeeCON Prague 2014*
The moose likes OO, Patterns, UML and Refactoring and the fly likes defualt multiplicity is 1 or 1..many? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "defualt multiplicity is 1 or 1..many?" Watch "defualt multiplicity is 1 or 1..many?" New topic
Author

defualt multiplicity is 1 or 1..many?

Stu Thompson
Hooplehead
Ranch Hand

Joined: Jun 14, 2006
Posts: 136
Hi all,

What is the default multiplicity? E.g.: if none is given? In my searches through the forums and the Internet I have found both "1 and only 1" and "1 to many".

I am particulary interested in the official Sun opinion as I am working on certifications.

Thanks,

Stu

[ July 28, 2006: Message edited by: Stu Thompson ]
[ July 28, 2006: Message edited by: Stu Thompson ]

"This is not to say that design is unnecessary. But after a certain point, design is just speculation." --Philip Chu
Scott Ambler
author
Ranch Hand

Joined: Dec 12, 2003
Posts: 608
What is the context? Are you talking about the UML? About something else?

- Scott


<a href="http://www-306.ibm.com/software/rational/bios/ambler.html" target="_blank" rel="nofollow">Scott W. Ambler</a><br />Practice Leader Agile Development, IBM Rational<br /> <br />Now available: <a href="http://www.ambysoft.com/books/refactoringDatabases.html" target="_blank" rel="nofollow">Refactoring Databases: Evolutionary Database Design</a>
Stu Thompson
Hooplehead
Ranch Hand

Joined: Jun 14, 2006
Posts: 136
UML.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
There isn't a real default. Multiplicities may be intentionally suppressed in one diagram but are usually specified in another (way).

The Unified Modeling Language Reference Manual 2e (2004) (amazon US)
p. 467

multiplicity:
...
Discussion:
...
The multiplicity may be suppressed on a diagram, but it exists in the underlying model. In a finished model, there is no meaning to an "unspecified" multiplicity. Not knowing the multiplicity is no different from saying that it is many, because in the absence of any knowledge, the cardinality might take any value, which is just the meaning of many.
See unspecified value.


p.667

unspecified value:
...
Discussion:
...
For example, multiplicity cannot be unknown; it must have some value. A lack of any knowledge is tantamount to a multiplicity of many. The semantics of UML therefore do not allow or deal with the absence of values or unspecified values.
...
There is another sense in which "unspecified" is a useful part of an unfinished model. It has the meaning "I have not yet though about this value, and I have made a note of it so that I will remember to give it a value later".
...
Semantically complete UML models do not have default or unspecified values; they simply have values.


So in the absence of any other knowledge an association with unspecified multiplicities is interpreted as many-to-many.
So you better specify your multiplicities somewhere even if the association is many-to-many to avoid any confusion.
Stu Thompson
Hooplehead
Ranch Hand

Joined: Jun 14, 2006
Posts: 136
Thank you very much for the authoritative response!

Stu
 
GeeCON Prague 2014
 
subject: defualt multiplicity is 1 or 1..many?