of 15
7/29/2019 Discuss a or El Act Erna Rio
1/15
SemanticsoftheMinimumMultiplicityinTernary
AssociationsinUML
GonzaloGnova,JuanLlorens,PalomaMartnez
ComputerScienceDepartment,CarlosIIIUniversityofMadrid,
Avda.Universidad30,28911Legans(Madrid),Spain{ggenova,llorens,pmf}@inf.uc3m.es
http://www.inf.uc3m.es/
Abstract.TheconceptofmultiplicityinUMLderivesfromthatofcardinalityin entity-relationshipmodeling techniques. TheUMLdocumentation defines
thisconceptbutatthesametimeacknowledgessomelackofobviousnessinthe
specification of multiplicities for n-ary associations. This paper shows an
ambiguity in the definition given by UML documentation and proposes a
clarification to this definition, as well as a simple extension to the current
notation to represent other multiplicity constraints, such as participation
constraints,thatareequallyvaluableinunderstandingn-aryassociations.
Introduction
The entity-relationship model [4] has been widely used in structured analysis andconceptualmodeling,andithasevolvedintoobjectorientedclassdiagramssuchas
those oftheUnifiedModelingLanguage[29].Thisapproach iseasytounderstand,
powerfultomodelreal-worldproblemsandreadilytranslatedintoadatabaseschema,
although other forms of implementation, such as object-oriented programming
languages,are notso simple andstraight [23].Both inentity-relationshipdiagrams
andinclassdiagramsthemain constructsare theentityand therelationshipamong
entities(classandassociation,inUMLterminology).Inthissense,importantauthors
strongly reject the entity-relationship approach, since they consider that the very
distinctionbetweenentityandrelationshipsuffersoflackofprecision[6,7].
Formanyanalysts,oneofthemostproblematicaspectsofsystemsmodelingisthe
correctunderstandingofternaryassociationsand,ingeneral,n-aryassociations(we
use this term, as usual, to refer to associationswith three ormore roles).Ternary
associations represent often a complex situation which modelers find speciallydifficulttounderstand,regardingbothstructuralandbehavioralmodeling.Fromthe
structuralpoint of view, thesedifficulties are very ofteninterlinkedwith the fourth
and fifth normal form issue [13]. From the behavioral point of view, atomic
interactions that involve more than two objects are another source of conceptual
complexity (these interactions are denoted by some authors as "joint actions" or
"atomicmultiwaysynchronousinteractions"[12]).
The cardinality of a relationship (multiplicity of an association, in UML
terminology)isconsideredbysomeexpertsasthemoststructuralpropertyofamodel
7/29/2019 Discuss a or El Act Erna Rio
2/15
[17]. However, the multiplicity values typically specified for n-ary associations
provideonlypartialunderstandingoftheobjectstructure.Additionalconditionsmay
be included within written descriptions that accompany the models, but a better
integration,asfarasitispossible,isalwaysdesirable.Worstofall,oftenthevery
meaningof themultiplicitiesisbadlyunderstood.Aswewillsee,themultiplicityofbinary associations is rather simple to specify and understand in UML, but,
unfortunately,thisisnotthecaseforn-aryassociations,forwhichUMLhasdefined
incompleteandunclearmultiplicities.
The purpose of this paper is, on the one hand, to clarify the meaning ofn-ary
multiplicityvalues,whichisacknowledgedbyUMLtobenotveryobvious[29,p.3-
73], and on the otherhand topropose an extension to the notationofUML n-arymultiplicities,oneextensionthatprovidesmorecompleteandprecisedefinitionsfor
n-aryassociationswiththesmallestnotationalburden.Althoughourmainconcernis
UML, the core of our exposition isgeneral enough to beuseful inothermethods
basedon the entity-relationship approach. Thiswork forms part ofa moregeneral
researchthatisaimedtowardsabetterunderstandingoftheconceptof"association"
among classes. We hope that this better understanding will improve the modelsconstructedbothbynovelandexpertanalysts.
The remainder of this paper is organized as follows. Section 1 recalls some
definitionsfromUML:multiplicity,association,andmultiplicityforbinaryandn-ary
associations. Section 2 searches the roots of these definitions in data modeling
techniquesthatderivemainlyfromtheentity-relationshipapproachofChen.Section3 reveals anambiguity, orat leastuncertainty, inthe definitionofUMLminimum
multiplicityforn-aryassociations;threealternativeinterpretationsarepresented,each
onewithitsownproblemsandunexpectedconsequences.Finally, section4 tries to
understand theroot of theseproblemsby payingmore attentionto theparticipationconstraint;anotationcompatiblewiththethreealternativeinterpretationsofsection3
isproposedtorecoveraplaceforthisconstraintinn-aryassociationsinUML,andits
semanticsiscarefullyexplained.
1 DefinitionofMultiplicityinUML
The Unified Modeling Language defines "multiplicity" as the range of allowable
cardinalitiesthatasetmayassume[29,p.3-68],where"cardinality"isthenumberof
elementsinaset[29,p.B-4].Acardinalityisaspecificvalue,whereasmultiplicityis
the range of possible cardinalities a set may hold [22, p. 182]. Multiplicity
specificationsaregivenmostlyforassociationends,buttheyareusedalso forother
purposes like repetitions of messages, etc. An "association" is the semanticrelationship between two ormore classes that involves connections (links) among
their instances [22, p. 152; 29, p. 2-19]. These are the definitions within UML,
although many authors, probably coming from the field of entity-relationship
modeling,willusethetermcardinalitytomeanmultiplicity,andthetermrelationship
tomeanassociation.Inthispaperweuseoneterminologyortheotherdependingon
thecontext.
7/29/2019 Discuss a or El Act Erna Rio
3/15
A binary association is drawn in UML as a solid path connecting two class
symbols.Themultiplicityofabinaryassociation,placedonanassociationend(the
target end), specifies the numberof target instances thatmaybeassociatedwith a
singlesourceinstanceacrossthegivenassociation,inotherwords,howmanyobjects
ofoneclass(thetargetclass)maybeassociatedwithagivensingleobjectfromtheotherclass(thesourceclass)[22,p.348;29,p.2-22].
Theclassicalexample inFigure1 illustratesbinarymultiplicity.Eachinstanceof
Personmaywork fornoneoroneinstanceofCompany(0..1),whileeachcompany
maybelinkedtooneormorepersons(1..*).Forthosereaderslessfamiliarizedwith
UMLnotation,thesymbol(*)standsfor"many"(unboundednumber),andtheranges
(1..1)and(0..*)maybeabbreviatedrespectivelyas(1)and(*).
Person Companyworksfor
1..* 0..1
Fig.1.Aclassicalexampleofbinaryassociationwiththeexpressionofmultiplicities
(Notethatthisassociationisintendedtomeanonlythepresentsituation:aperson
is working for 0..1 companies, but not "a person has worked or works for 0..1companies". In this paper we are going to avoid all issues of history, since this
concernwoulddepartusfromourmainobjective.)
An n-aryassociation isan association among threeor moreclasses, shownasa
diamondwithapathfromthediamondtoeachparticipantclass.Eachinstanceofthe
associationisann-tupleofvaluesfromtherespectiveclasses (a3-tupleortriplet,in
thecaseofternaryassociations).Multiplicityforn-aryassociationsmaybespecified,but is less obvious than binarymultiplicity. Themultiplicityonanassociationend
representsthepotentialnumberofvaluesattheend,whenthevaluesattheothern-1
endsarefixed[29,p.3-73].Thisdefinitioniscompatiblewithbinarymultiplicity[22,
p.350].
TheexampleinFigure2,takenfromtheUMLReferenceManual[22,p.351]andtheUMLStandard[29,p. 3-74],showstherecordofa teamineachseasonwitha
particular goalkeeper. It isassumedthatthe goalkeepermightbe traded during the
seasonandcanappearwithdifferentteams.Thatis,foragivenplayerandyear,there
maybemanyteams,andsoonfortheothermultiplicitiesstatedinthediagram.
7/29/2019 Discuss a or El Act Erna Rio
4/15
Team
Year
Player* *
*
Fig.2.Ternaryassociationwithmany-many-manymultiplicities
However,asweshallsee,asubtleparadoxhidesbehindtheapparentclearnessof
thesemultiplicityspecifications.
2 DefinitionofCardinalityinEntity-RelationshipModels
Thedefinition ofmultiplicityof anassociation inUMLfollows that ofOMT[24],
whichisgenerallyacknowledged[2,20]toderivefromthedefinitionofcardinalityof
arelationshipintheentity-relationshipmodel[4].Infact,Chendoesnotusetheterm
"cardinality"in hisproposal:heusestheexpressions"1:1mapping","1:nmapping"and"m:nmapping",andheexplainsthemeaningofeachone,buthedoesnotgive
any formaldefinitionoftheconceptof"type ofmapping".Moreover, hedrawsanexampleofanM:N:PternaryrelationshipSUPPLIER-PROJECT-PART,buthedoes
notexplainat allhow these "cardinalities"are tobeunderstood.Note,too, that he
deals only with "maximum cardinality", in a close relation to the concept of
"functionaldependency".
Manydatamodelingtechniqueshavefollowed,formalizedandextendedtheChen
styleofcardinality values[8,10,18,21,28].Others,followingtheFrenchmethod
Merise [27], invert the placement of cardinality values [1, 3, 5]. It has beenwell
established that the semantics of both conventions are equivalent for binary
relationships,butdiffersubstantiallywhentheyareappliedtorelationshipsofhigherdegree[2,19,20,26].Thisissuewillbedealtwithmoredetailinsection4.
Insomeof thesemethodswe findtheexplicitandusefuldistinctionbetweenthe
conceptsofacardinalityconstraintandaparticipationconstraint[10,18,26]:
Acardinalityconstraintspecifiesthenumberofrelationshipinstancesinwhichanentitycanparticipate.Theyareintheformof1:1,1:N,orM:N,toexpress
thetwoconstraintsinabinaryrelationship,and1:1:1,1:1:N,1:N:M,orM:N:P,to express the three constraints in a ternary relationship. These constraints
correspondtomaximum cardinality constraintsin somenotations. In theChen
style, theentitywitha cardinality constraintof1 isfunctionallydependenton
theotherentity(orentities,inann-aryrelationship).IntheexampleinFigure1,
CompanyisfunctionallydependentonPerson.
7/29/2019 Discuss a or El Act Erna Rio
5/15
Aparticipationconstraintspecifieswhetheranentityinstancecanexistwithout
participatinginarelationshipwithanotherentity.Thisconstraintcorrespondsto
minimum cardinality constraints in some notations. Total and partial
participationare thetwotypesofparticipation,alsodenotedasmandatoryand
optional participation.Mandatory participation existswhen an entity instancecannotexistwithoutparticipatinginarelationshipwithanotherentityinstance.
Optional participation exists when the entity instance can exist without
participating in a relationship with another entity instance. In the example in
Figure 1, Company has mandatory participation, while Person has optional
participation.
Other authors define in a more general way a co-occurrence constraint, whichspecifies howmany objects (orn-tuplesofobjects)may co-occur in a relationship
with another object (or m-tuple of objects) [11]: for example, how many pairsproduct-prize may co-occur with a particular pair seller-buyer in the 4-ary
relationship sale. Thisgeneralized conceptof cardinality is studiedmoredeeplyin
section4.
Some methods combine cardinality and participation constraints and representthem usingminimum andmaximumconstraints in theformof(min,max) notation.
This is the case of UML. However, the concept of minimummultiplicity is not
equivalent to the concept of participation constraint. For example, a minimum
multiplicityof2impliesmandatoryparticipation,butmandatoryparticipationimplies
only a minimum multiplicity of 1. Moreover, the potential multiplicities in UMLextendtoanysubsetofnonnegativeintegers[22,p.346],notonlyasingleintervalas
(2..*), not even to a comma-separated list of integer intervals as (1..3, 7..10, 15,
19..*): specifications ofmultiplicity like {prime numbers} or {squares of positive
integers}arealsovalid,althoughthereisnostandardnotationforthem.Nevertheless,inUML as in other modeling techniques, the most usual multiplicities are (0..1),
(1..*),(0..*)and(1..*).Wearegoingtorestrictouranalysistothesecombinationsofmultiplicityvalues.
3 ParadoxesandAmbiguitiesofTernaryMultiplicities
Let's recall the definition of UML multiplicity in an n-ary association: "themultiplicity onanassociation end represents the potential number ofvalues at the
end, when the values at the other n-1 ends are fixed". Now consider the ternary
association"AworksinBusingC",whichisaclassicalexampleintheliterature[20],
definedamongemployees,projectsandskills:anemployeeworksinacertainproject
usingacertainskill.Table1illustratespossiblesetsofinstancesforthethreeclasses,
whileTable2illustratesapossiblesetofinstances(triplets)fortheassociation.
Table1.ThreepossiblesetsofinstancesforthethreeclassesEmployee,Project,Skill
Employee Project Skill
Albert Kitchen Welding
Benedict Laboratory Painting
Claire Basement Foreman
7/29/2019 Discuss a or El Act Erna Rio
6/15
Table2.Possiblesetofinstancesfortheternaryassociation"works-in-using"
worksinusing
Employee Project Skill
Albert Kitchen Welding
Albert Laboratory Welding
Benedict Kitchen Foreman
Benedict Basement Foreman
Claire Kitchen Painting
Figure3showsadiagramforthisternaryassociation,withmultiplicityconstraints
that,accordingto thedefinitiongivenabove,areconsistentwiththevaluesinTables
1and2:
MultiplicityforclassProjectinassociation"works-in-using"is0..*,sinceann-
tupleofinstancesofEmployee-Skillmaybelinkedtoaminimumof0andan
unboundedmaximumofinstancesofProject:tupleAlbert-Weldingis linkedto
two different instancesofProject, Kitchen and Laboratory, and the same for
Benedict-Foreman.
MultiplicityforclassEmployee,also0..*,isconsistentaswell:althoughthereis
nopairProject-SkilllinkedtotwodifferentinstancesofEmployee,thediagram
states that a tuple such asClaire-Laboratory-Welding,which would duplicate
thepairLaboratory-Welding,maybeaddedtotheexistingsetoftuples.
Finally,multiplicity for class Skill, in this case 0..1, states that for each pair
Employee-Projecttheremaybenoneoroneskill:thatis,anemployeeusesat
mostoneskillineachproject,whichisconsistentwiththegivenvalues,butthe
constraintalsoforbidsaddingatuplesuchasClaire-Kitchen-Weldingunlessthe
tuple Claire-Kitchen-Painting is deleted first. In other words, Skill is
functionallydependentonEmployee-Project.
Employee Project
Skill
worksin
using
0..* 0..*
0..1
Fig.3. Theternary association"works-in-using",accordingto theinterpretationofpotential
tuples
Now,everythingseemsworkingwellbutthat'snotthateasy.Sofar,inapplying
thedefinition to thisexamplewe haveconsideredonlymaximummultiplicity.Let's
concentrate now on minimum multiplicity, and we will see that there is some
7/29/2019 Discuss a or El Act Erna Rio
7/15
ambiguity in its definition. We are going to propose and examine three different
interpretations of the phrase "each pair Employee-Project", inviting the reader to
check which one he or she has accepted until now, probably in an unconscious
manner.Wewillshowthateachoneoftheseinterpretationshasalsoitsownproblems
and unexpected consequences. As far as we know, nobody has made this point
beforehand.
First interpretation (actual tuples). "Each pair Employee-Project" may be
understoodasan"actuallyexistingpair",oranactualpair,thatis,apairofinstances
that are linked by some ternary link within the ternary association. Pairs Albert-
KitchenandBenedict-Basementareactualpairs,sincethereareinfactsometriplets
thatcontainthem,whilepairsAlbert-BasementandClaire-Laboratoryarenot.
Thisinterpretationoftheruleseemsratherintuitive,butnotethatforanactual
pairEmployee-Projecttheremustbe alwaysat leastoneSkill:ifitisanactualpair,
thereisanactualtripletthatcontainsit,thereforethereisaninstanceofSkillthatis
also in the triplet. There cannot be an actual pairthat is not connected to a third
element,becauseaternarylinkisbydefinitiona tripletofvaluesfromtherespective
classes;a ternary linkhas three"legs", and noneofthemmaybeempty:"limping"
linksarenotallowed.
So,inthisinterpretation, theminimummultiplicityisalwaysatleast1 ,sincethe
value0hasnosense.This"zero-forbiddeneffect"isnotconsistentwiththefrequent
assigningofminimum multiplicity 0 in ternary associations (and, first of all, with
UMLdocumentation,as intheexampleinFigure2).Infact,thediagraminFigure3
wouldbeincorrect,althoughitcouldbesubstitutedbytheoneinFigure4.
Employee Project
Skill
worksin
using
1..* 1..*
1..1
Fig.4.Theternaryassociation"works-in-using",accordingtotheinterpretationofactualtuples
Secondinterpretation(potentialtuples). "ForeachpairEmployee-Project"maybe
understoodasa"merelypossiblepair",orapotentialpair,thatis,apairofinstances
that belongs to the Cartesian product of Employee and Project. There are three
employees and three projects, so there are nine potential pairs. For some of these
pairs, like Benedict-Basement or Claire-Kitchen, there is a related skill; for some
others, like Albert-Basement or Claire-Laboratory, there is none. So, minimum
multiplicity0 isallowed inTables1 and 2,and the diagram inFigure 3would be
correctandconsistentwiththem.
7/29/2019 Discuss a or El Act Erna Rio
8/15
But,whatwouldbethemeaningofminimummultiplicity1?Considermultiplicity
1..1assignedtoclassSkill,asinFigure4.Itwouldmeanthat,foreachpotentialpair
Employee-Product,theremightbeoneSkill,butnotzero;thatis,anypotentialpair
notlinkedtoaskillwouldbeforbidden.Inotherwords,anypotentialpairmustbe
linked toat leastoneskill,and thereforeanypotentialpairEmployee-Productmustexistatleastoncewithinonetripletintheassociation:everyemployeemustbelinked
toevery project atleast once.Thisruleand the diagramin Figure 4would not be
consistentwiththevaluesinTables1and2,sincewewouldneedthefullCartesian
productEmployee-ProducttobepresentinTable2(infact,weshouldhaveexactly
ninelinesandnomore,duetomaximummultiplicity1ofSkill).
So,inthisinterpretation,aminimummultiplicity1assignedtooneclassforcesallpotential pairs of instances of the remaining classes to actually existwithin some
triplet.Thiswouldbea"bouncingeffectoftheone"thatisprobablyunexpectedby
mostmodelers. Nevertheless, this interpretation seems valid, as it is implicitly in
agreement with UML documentation and some works on the formalization of
multiplicities[20].
Third interpretation (limping links). We could try an entirely different kind of
interpretation, bymeans of allowing theexistence of limping links, that is, ternary
linksthatlinkonlytwoinstancesandleaveablankforthethirdone.Thus,wewould
readthemultiplicityforclassSkillinFigure3as"eachactualpairEmployee-Project
maybelinkedtononeoroneinstanceofSkill",thatis,eachlinkwouldbeactuallyeitherapairEmployee-Project(belongingtoahiddenbinaryassociation)ora triplet
Employee-Project-Skill(belongingtothetrueternaryassociation).Onthecontrary,if
multiplicitywere1..1, then limpinglinkswouldnotbe allowedonthesideof class
Skill:everyactualcombinationofemployeeandprojectshouldhaveaskilllinkedtoit.Withinthisinterpretation, thediagraminFigure3wouldbeequivalenttotheone
in Figure 5, in which the limping links have been removed from the ternary
association,andare represented in a superimposedexplicit binaryassociation (this
couldbefurtherdonewiththeothertwozero-multiplicities).
7/29/2019 Discuss a or El Act Erna Rio
9/15
Employee Project
Skill
worksin
using
0..* 0..*
1..1
0..* 0..*
Fig. 5. The ternary association "works-in-using", according to the interpretation of limpinglinks,inwhichthelimpinglinksonthesideofSkillareshownasanexplicitbinaryassociation
In this interpretation, the ternary association symbol isused asan abbreviated
form to represent a genuine ternary association together with a hidden binary
association. Probablymanymodelersuse the ternary symbol as ifit were tomean
this, but, in general, the procedure ofmerging a binary association with a ternary
associationby usinglimping linksis not advisable.Ontheotherhand,UML states
thateachinstanceofann-aryassociationisann-tupleofvaluesfromtherespective
classes(recallsection1ofthispaper).
Thelimping linksinterpretation for incomplete associationsis avariationof the
actual pairs interpretation, in which minimum multiplicity 0 means that a lack of
informationisallowed.Nevertheless,therearesomedifficultiesleft:Howmanylegs
may be lacking in an n-ary link? One, two, up to n-2? How is the maximummultiplicityconstrainttobeinterpretedwhenalegislackingonanoppositeend?
So,thisinterpretationmayseemsimpleandusefulatfirstglance,buttherearestill
somepointsthatarenotatallclear,firstofalltheverydefinitionofn-aryassociation
inUML.Theseunsolvedsemanticdifficultiesareenough,inouropinion,todiscard
theconceptofa limpinglinkasamisleadingone,inspiteofitsapparentadvantages,
in favor of the more rigorous approach of the potential pairs interpretation. In
consequence, in the rest of this paper we adopt this interpretation for clearness,
althoughtheissuesaddressedareuptoapointindependentofthischoice.
4 APlacefortheParticipationConstraint
We have seen three different interpretations that could solve the ambiguity in the
definition of minimum multiplicity of n-ary associations in UML. The first one,
actual pairs, implies that minimum multiplicity must be always 1, which is not
consistentwith documentation and practice; the second one,potential pairs, seems
correctbuthas a strange effectwhen the valueis 1;thethirdone, limpinglinks,is
semantically weak and contradicts the definition of n-ary association. Why is
minimummultiplicityinn-aryassociationssoelusive?
7/29/2019 Discuss a or El Act Erna Rio
10/15
McAllister offers a good formalization of the concept of cardinality (or
multiplicity,inUMLterminology)[20].Beingaandbtwonon-null,non-overlapping
setsofroles inann-aryrelationshipR,thecardinalityC(a,b)=(min,max)specifies
thatanygivensetofentityinstancesofamustbeassociatedbyRwithbetweenmin
andmaxuniquesetsofentityinstancesforb (forsimplicity,werestrictourselvestothesimplestformofcardinality,asingleintegerinterval,althoughthisdoesnotaffect
the reasoning).Note that this corresponds to the co-occurrence constraint defined
above.IntheexampleofFigure3,ifa={Employee,Skill}andb={Project},then
C(a,b)= (0..*).McAllisterdemonstrates that thetotalnumberofcardinalityvalues
thatmaybedefinedina relationshipwithNrolesisgivenby3N-2N+1+1,andapplies
thiscalculationforNfrom2to5,givingtheresultsinTable3.
Table3.TotalnumberofcardinalityvaluesthatmaybedefinedinarelationshipwithNroles
N=numberofrolesinR numberofC(a,b)forR
2 2
3 12
4 50
5 180
AsN increases, there isa rapidincrease inthe numberofcardinalityvaluesthat
shouldbeanalyzedifthenatureoftherelationshipistobefullyunderstood.Thismay
beonefactorwhymanydatamodelingpractitionersencounterdifficultiesindealing
with n-ary relationships, especially if only a small number of the applicable
cardinalitiesareconsideredforeachsuchrelationship.
ForN=3,aternaryrelationshipsuchas"works-for-using",thetwelvevaluestobe
consideredare: the three Chen/UML style values, the threeMerise values,andsixvalues for the three embedded (that is, implicit) binary relationships Employee-
Project, Employee-Skill andProject-Skill (remembertheyarenottruly independent
relationships).McAllisterfurtherdefinesasetofrulesforconsistencychecking,since
thesevaluesarenotcompletelyindependent[20].Tofullyunderstandthestructureof
ann-aryrelationship,themodelershouldspecifyallthese co-occurrenceconstraints,
butmostoftimesitisenoughwiththeNChenvaluesandtheNMerisevalues(theothersbeingusuallymany-to-many[15]).Whenthesevaluesarespecifiedassimple
(min,max) intervals,consistencybetweenChenandMerisevaluesisdeterminedby
ensuring thateachminormax Chenvalue isless thanorequal totheminormax
Merisevaluesoftheotherclasses[20].Thisrulemaybecheckedagainsttheexample
inFigure6,whichshowsbothsetsofvalues:minChenforSkillis0,whichisequalto
minMerise for Employee (0)andless thanminMeriseforProject(1);maxChenfor
Skillis1,whichislessthanmaxMeriseforEmployee(*)andmaxMeriseforProject
(*). If, besides Chen and Merise values, the other values are also important,
McAllister'stabularrepresentationforrelationshipcardinalityisagoodchoice;these
cardinality constraints that are difficult to express in traditional entity-relationship
models are also very naturally expressed using assertions [17] ("assertions" aredeclarativespecificationsofwhathastobetrueinthe"stablestate"ofthesystem,that
is,outsideofatomicoperations;theyarealsoreferredtoas"invariants").
7/29/2019 Discuss a or El Act Erna Rio
11/15
0..* 1..*
0..*
Chen
Merise
Employee Project
Skill
worksinusing
0..* 0..*
0..1
Fig.6.Theternaryassociation"works-in-using",showingbothChenandMerisemultiplicity
values
We can better understand now the semantic problems ofminimum multiplicity
considered above. Minimum multiplicity is associated with the participation
constraint,butinthecaseofaternaryassociation,intheChenstyle,itdoesnotmean
theparticipationoftheclass,buttheparticipationofapairoftheothertwoclasses.A
value0forSkilldoesnotmeanoptionalparticipationforSkillintheassociation,but
optionalparticipation forinstancepairs ofEmployee-Projectin theassociationwith
aninstanceofSkill.Ifthisgoesagainstintuition,allthemorereasontobeclarified.
In fact, the participationofeach individual class remains unexpressed intheChen
style,whiletheMerisestylerepresentsitadequately.Ontheotherside,the functional
dependenciesremainunexpressedintheMerisestyle,whiletheyarerepresentedby
maximummultiplicity1intheChenstyle.ThisisprobablythereasonwhyOMTand
UML have chosen Chen instead ofMerise,although functional dependency is not
inherentlymoreimportantthanparticipation.
BothChenandMerisestylesarecorrectandcandescribethesameassociation,but
theystatedifferentfactsaboutthenatureoftheassociation.Thefactsrepresentedby
each stylearenot specifiedwhenusingtheother,norcantheybederivedfrom the
other(exceptinthecaseofbinaryassociations,wheretheysimplyinterchangetheir
placement).Therefore,if thetwostylesprovideusefulinformationtounderstandthe
association, why not represent both in the same diagram? Figure 6 repeats the
example of Figure 3, but adding a set of Merise values close to the association
diamond.ThisvaluesareconsistentwiththevaluesinTables1and2,andaddnew
and useful semanticsto the association:we note especially thatclassProjectis the
only one that has mandatory participation (minMerise for Project is 1), that is, a
projectcannotexistwithoutbeinglinkedtoapairemployee-skill,althoughtheremay
be many (potential) pairs employee-skill not linked to any project (minChen for
Projectis0);andwenotealsothatclassSkillmayparticipateinmultipleassociation
instances (maxMerise for Class is*),thatis, a certain skillmaybe linked tomany
differentpairsemployee-skill, although for each pair atmostone skillcan beused
(maxChenforClassis1).
7/29/2019 Discuss a or El Act Erna Rio
12/15
Thisnotationmayseem similar to thatof replacing the ternaryassociation bya
new entity and three binary associations that simulate the ternary association, as
shown inFigure 7. This new entity is usually referred to as intersection entity orassociativeentityorgerund[26].WenotethattheMerisevaluesofmultiplicityare
preservedinthistransformation,andplacedagaincloseto theassociativeentity,butallChenvalueshavebeenreplacedby1..1,sinceeveryinstanceofWorkislinkedto
oneandonlyoneinstanceoftheotherclasses(thisisthesameassayingthatevery
ternary link has "three legs"). In other words, the semantics of functional
dependenciesexpressedby theternaryassociationare lostwhensimulatingitwitha
gerund,but thesemanticsofparticipationarepreserved.Thereareotherdifferences
between binary and ternary associations and, in general, binary representations ofternaryassociationsarenotfunctional-dependencypreserving[14,16,25].
Employee Project
Skill
Work1..1 0..*
1..1
0..*
1..11..*
Fig.7.Theternaryassociation"works-in-using"substitutedbytheassociativeentity"Work".
OnlyMerisemultiplicityvaluesarepreservedinthetransformation
Conclusions
Inthispaperwehaveconsideredsomesemanticproblemsofminimummultiplicityin
n-ary associations,as it iscurrentlyexpressed inUML; nevertheless, our ideas are
generalenoughtobe applicable toothermodelingtechniquesmoreorlessbasedonthe entity-relationship approach. Minimum multiplicity is closely related to the
participationconstraint,althoughinthecaseofn-aryassociationsitdoesnotmeantheparticipationoftheclassintheassociation,buttheparticipationoftuplesoftheother
n-1 classes. Moreover, we discovered that this latter participation is defined with
uncertainty,allowingthree conflictive interpretations: participationof actual tuples,participationofpotentialtuples,andparticipationwithlimpinglinks.
The second interpretation seems more probable, as it is implicitly inagreement
withUMLdocumentation,inspiteofthebouncingeffectofminimummultiplicity1.
The Standard should clarify this question, without resigning itself to a lack of
obviousnessin thedefinition.Besides, ifthissecondinterpretationwerechosen, the
7/29/2019 Discuss a or El Act Erna Rio
13/15
Standard should also warn, since this result is not at all intuitive, that aminimum
multiplicity1orgreaterassignedtooneclassforcesallpotentialtuplesofinstancesof
the remaining classes to actually exist within some n-tuple; therefore, minimum
multiplicitywouldbe0innearlyeveryn-aryassociation.
The third interpretation,whichisavariationof thefirst one,seemsintuitiveand
hasalsosomepragmaticadvantages,althoughitisincontradictionwiththedefinition
of n-ary association inUML (maybe more with the letter thanwith the spirit). In
addition,ithassomeunsolvedsemanticdifficultiesthathaveleadustodiscardit,at
leastforthetimebeing.
The eventual clarification of this point leaves another problem unresolved: the
participation of each class remains unexpressed in the Chen style of representing
multiplicities (which is also the UML style), while the Merise style shows it
adequately. Both Chen and Merise styles are correct, but they describe different
characteristicsof thesame association,whichcannotbederived from eachother in
then-arycase,althoughtheyarerelatedbyasimpleconsistencyrule.
Being both styles useful to understand the nature ofassociations,weproposea
simple extension to the notation of UML n-ary multiplicities that enables the
representationof bothparticipation and functionaldependency(that is,Meriseand
Chen styles). Since this notation is compatible with the three alternative
interpretationsofChenmultiplicities,itsusedoesnotavoidbyitselftheambiguityof
the definition ofmultiplicity: they are independent problems. If this notationwere
accepted, the Standard should also modify the metamodel accordingly, since it
foresees only onemultiplicityspecification in theAssociationEndmetaclass. If this
werenotthecase,itcouldbeatleastrecognizedthatChenmultiplicitiesarenotthe
onlysensibleco-occurrenceconstraintsthatmaybedefinedinann-aryassociation.
Understandingn-aryassociationsisadifficultproblemin itself.If therulesofthelanguageusedtorepresentthemarenotclear,thistaskmaybecomeinaccessible.If
the interpretation of n-ary associations is uncertain, straight communication among
modelersbecomesimpossible.Ifthesemanticimplicationsofamodelareambiguous,
implementerswillhavetotakedecisionsthatdonotcorrespondtothem,andpossibly
wrong decisions. These reasons are more than enough to expect a more precise
definitionofUMLonthistopics.
Acknowledgements
Theauthorswould like to thankVicente Palacios and JosMiguel Fuentes for his
frequent conversations on the issues discussed in this paper; JorgeMorato for his
stylisticcorrectionsonthefirstdraft;AnaMaraIglesias,ElenaCastroandDolores
Cuadrafortheusefulbibliographicmaterialprovidedforthisresearch,andcriticism
onthefirstdraft;andGuyGenilloudforhismanysuggestionstoimprovethispaper.
7/29/2019 Discuss a or El Act Erna Rio
14/15
References
1. Batini,C., Ceri,S.,Navathe,S.B.:ConceptualDatabaseDesign: anEntity-Relationship
Approach.Benjamin-Cummings(1992)
2. Castellani,X.,Habrias,H.,Perrin,Ph.:"ASynthesisontheDefinitionsandNotationsof
Cardinalities of Relationships",Journal of Object Oriented Programming, 13(6):32-35
(2000)
3. Ceri,S.,Fraternali,P.:DesigningDatabaseApplicationswithObjectsandRules:theIDEA
Methodology.Addison-Wesley(1997)
4. Chen,P.P.: "TheEntity-RelationshipModel",ACM Transactions on Database Systems,
1(1):9-36(1976)
5. Coad,P.,Yourdon,E.:Object-OrientedAnalysis,2nded.Prentice-Hall(1991)
6. Codd,E.F.:TheRelationalModelforDatabaseManagament:Version2.Addison-Wesley
(1990)7. Date,C.J.:AnIntroductiontoDatabaseSystems,6thed.Addison-Wesley(1995)
8. DeMiguel,A.,Piattini,M.,Marcos,E.:Diseo de basesde datos relacionales.Ra-Ma,
Madrid(1999)
9. Dullea, J., Song, I.-Y.: "An Analysis ofStructuralValidity ofTernary Relationships in
Entity-Relationship Modeling", Proceedings of the 7th International Conference on
InformationandKnowledgeManagement,331-339,Washington,D.C.,Nov.3-7(1998)
10.Elmasri, R., Navathe, S.B.: Fundamentals of Database Systems, 2nd ed. Benjamin-
Cummings(1994)
11.Embley,D.W.:ObjectDatabaseDevelopment:ConceptsandPrinciples.Addison-Wesley
(1998)
12.Genilloud, G.: "Common Domain Objects in the RM-ODP Viewpoints", Computer
StandardsandInterfaces,19(7):361-374(1998)
13.Hitchman,S.: "Ternary Relationships--To Three or not toThree, Is there a Question?"
EuropeanJournalofInformationSystems,8:224-231(1999)
14.Jones, T.H., Song, I.-Y.: "Binary Representations of Ternary Relationships in ER
Conceptual Modeling", 14th International Conference on Object-oriented and Entity-
RelationshipApproach,pp.216-225,GoldCoast,Australia,Dec.12-15(1995)
15.Jones,T.H.,Song, I.-Y.:"AnalysisofBinary/TernaryCardinalityCombinationsinEntity-
RelationshipModeling",Data&KnowledgeEngineering,19(1):39-64(1996)
16.Jones, T.H., Song, I.-Y.: "Binary Equivalents of Ternary Relationships in Entity-
Relationship Modeling: a Logical Decomposition Approach", Journal of Database
Management,April-June:12-19(2000)
17.Kilov,H., Ross,J.:InformationModeling: AnObject-Oriented Approach. PrenticeHall
(1994)
18.Martin,J.,Odell,J.:Object-OrientedMethods:AFoundation.PrenticeHall(1995)
19.Martnez,P.,Nieto,C.,Cuadra,D.,DeMiguel,A.:"Profundizandoenlasemnticadelas
cardinalidades en elmodeloE/R extendido",IV Jornadas de Ingeniera del Software y
BasesdeDatos,pp.53-54,Cceres,Spain,Nov.24-26(1999)
20.McAllister,A.:"ModelingN-aryDataRelationshipsinCASEEnvironments", Proceedingsofthe7thInternationalWorkshoponComputerAidedSoftwareEngineering ,pp.132-140,
Toronto,Canada(1995)
21.Metodologadeplanificacinydesarrollo desistemasde informacin,METRICAversin
2.Tomo3:Guadetcnicas .InstitutoNacionaldeAdministracinPblica,Espaa.Madrid
(1993)
22.Rumbaugh,J.,Jacobson,I.,Booch,G.:TheUnifiedModelingLanguageReferenceManual.
Addison-Wesley(1998)
7/29/2019 Discuss a or El Act Erna Rio
15/15
23.Rumbaugh, J.: "Relations as Semantic Constructs in an Object-Oriented Language",
Proceedings of the ACM Conference on Object-Oriented Programming: Systems,
LanguagesandApplications,pp.466-481,Orlando,Florida(1987)
24.Rumbaugh, J., Blaha, M., Premerlani, W., Eddy, F., Lorensen, W.: Object-Oriented
ModelingandDesign.Prentice-HallInternational(1991)
25.Song,I.-Y., Jones,T.H.: "Analysisofbinaryrelationshipswithin ternaryrelationships in
ERModeling",Proceedingsof the12th InternationalConferenceonEntity-Relationship
Approach,pp.265-276,Dallas,Texas,Dec.15-17(1993)
26.Song, I.-Y., Evans, M., Park, E.K.: "A Comparative Analysis of Entity-Relationship
Diagrams",JournalofComputerandSoftwareEngineering,3(4):427-459(1995)
27.Tardieu,H.,Rochfeld,A.,Coletti,R.:LamthodeMERISE.Tome 1:Principleset outils.
LesEditionsd'Organisation,Paris(1983,1985)
28.Teorey,T.J.:DatabaseModelingandDesign,3rded,MorganKaufmannPublishers(1999)
29.ObjectManagementGroup:UnifiedModelingLanguageSpecification,Version1-3,(June
1999)