0
votes

In ERM, there is the possibility to model relationships between entities in a way to stress that one object is always assigned to exactly another object, e.g.:

Person --*-- -1- Location

which would mean that every instance of Person has a birth location assigned to it.

I am looking for a translation in UML for it. Is this possible?

I was first coming up with the bidirectional association in UML of

Person -*--1- Location

which would correspond to https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model#/media/File:ERD_Representation.svg . However, I am unsure about this: The UML specification states that an Association specifies a semantic relationship that can occur between typed instances. Based on this, cases in which there is no association between objects of the class Person and Location would also be allowed. On the other hand, https://developer.ibm.com/articles/the-class-diagram/ interprets multiplicities as The multiplicity value next to the Plane class of 0..1 means that when an instance of a Flight exists, it can either have one instance of a Plane associated with it or no Planes associated with it, which would mean that an UML association actually enforces what associations created objects can have.

The same question basically applies for unidirectional associations: Does

OverDrawnAccountsReport ----1,*-> BankAccount

Does this mean that each OverDrawnAccountsReport is about at least one BankAccount or does this also allow cases in which OverDrawnAccountsReport exists without such an association.

I have also been looking into aggregation and compositions, however, these seem to be optional to me and put emphasis onto what happens to the owner part object if the owner object is destroyed etc.

1

1 Answers

2
votes

Yes, this translation, as illustrated in the diagram of your Wikipedia link, is correct. The characterization that "a relationship can occur between instances" just refers to the general case. In the special case where there is a multiplicity expression of 1 at an association end, this implies a cardinality constraint of "exactly one" and, consequently, in that case, a relationship must occur between instances.

However, I'm not sure what you mean with "bidirectional" association? Notice that this term is not defined in the UML.