Book a Demo

Author Topic: Multiplicity vs Cardinality  (Read 7342 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Multiplicity vs Cardinality
« on: April 27, 2005, 12:31:44 am »
What's going on?  Why are there two concepts?  [glb]And why are there two different fields in the Database for these?[/glb]

Right-click on calls you get Mutliplicity (visible), Class properties|Detail gets you Cardinality.  They can have different values...

I was brought up to view multiplicity as the union of cardinality (how many there are) and optionality (are there any)....

From EA's own help file...

multiplicity  
 
A specification of the range of allowable cardinalities that a set may assume. Multiplicity specifications may be given for roles within associations, parts within composites, repetitions, and other purposes. Essentially a multiplicity is a (possibly infinite) subset of the non-negative integers.  
??? ::)

Paolo
« Last Edit: April 27, 2005, 12:40:20 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: Multiplicity vs Cardinality
« Reply #1 on: April 27, 2005, 12:43:52 am »
The glossary does specify the difference:
- cardinality, number in a [specific] set
- multiplicity, range of allowed cardinalities

So one is a superset of the other.
Perhaps the Help could be more .... helpful though.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Multiplicity vs Cardinality
« Reply #2 on: April 27, 2005, 01:16:01 am »
As per my original post, cardinality is a proper subset of multiplicity.  You can't have two independent values.  They are just NOT connected in EA...  ???

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: Multiplicity vs Cardinality
« Reply #3 on: April 27, 2005, 01:54:40 am »
So you're suggesting that EA should either a) display both together or b) constrain the one according to the other ?

I suppose option a) would be most flexible, to avoid a situation where you wanted to change the range of one, but couldn't until you had changed the other.

There could then be a little icon saying "cardinality not consistent with multiplicity !!"

PS. am running in an EA-free context these days ... perhaps I should refrain from commenting since I can't reproduce issues ...
« Last Edit: April 27, 2005, 01:55:55 am by mikewhit »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Multiplicity vs Cardinality
« Reply #4 on: April 27, 2005, 06:08:43 am »
Sorry Mike, (couldn't resist)

How flexible do you want the wrong answer?

From number theory, cardinal numbers start at 1.

That's why you can't use 0 as the lower bound of a cardinality.  Therefore, UML uses the term multiplicity - which they have defined as 0..oo

The quote you have, from the Glossary, for cardinality is correct, but not of much direct use.

The UML definition (§7.3.32) for MultiplicityElement is: A multiplicity is a definition of an inclusive interval of non-negative integers beginning with a lower bound and ending with a (possibly infinite) upper bound. A multiplicity element embeds this information to specify the allowable cardinalities for an instantiation of this element.

Since, by defintion, when you instantiate an element you must have at least one instance, the definition holds good in both parts.

However, when dealing with the number of elements you might find at the end of a relation, which may be optional, the minimum number may be 0, therefore only the first part of the definition is really applicable.

For those of us who "grew up" in the data management world, the separation of cardinality and optionality is well understood - hence the "crows foot" symbology of the ER diagram.  Multiplicity combines both into one concept.

What I am explicitly saying is:
1) You shouldn't need two concepts, one includes the other
2) if you do decide to have 2 concepts you actually need three (multiplicity, optionality, cardinality) and you must constrain all three according to the appropriate rules (not elaborated here).

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: Multiplicity vs Cardinality
« Reply #5 on: April 27, 2005, 09:13:15 am »
Sorry, I had read "A specification of the range of allowable cardinalities that a set may assume" and thought it meant that cardinalities of 1..3, 2..4 and 7..9 would be included in a multiplicity of 1..9 - ie. a range of allowed cardinalities.

But without knowing the subject domain, I was just working from the literal definitions.