0

I am getting confused at qualification association. I perform qualification when I need to remove many-to-many relationship or when the PK of a particular table is not able to be uniquely identify a row - in this case I make a composite key by qualifying it.

That said, I do not understand whether after performing a qualification, will the relationship becomes one-to-many or one-to-one. Some of my friends said that after qualification, it is always a one-to-many relationship but after reading some sites, it says qualification reduces the multiplicity. This particular sentence from a few websites confused me:

qualification reduces the multiplicity at the target end of the association, usually down from many to one, because it implies the selection of usually one instance from a larger set.`

Given the below simple conceptual schema,

enter image description here

In this case, will this consider a one-to-one relationship or a one-to-many relationship?

lennon310
  • 3,132
  • 6
  • 16
  • 33
Sunny J
  • 11
  • 2
  • The terminology in this question seems to be confused - the question seems to have nothing whatsoever to do with UML or UML Class diagrams, rather it seems to be asking about an Entity-Relationship Diagram. UML Class diagrams are not usefully able to describe tables or relational databases. – Ben Cottrell Jul 24 '21 at 07:57
  • Hey thanks. I believe this is more towards conceptual schema (is conceptual schema ER?). – Sunny J Jul 24 '21 at 08:06
  • What Ben Cottrell is saying is that UML is generally not meant for databases and database schemas (although there's an extension for database modeling). In any case, the qualified association just means "If I supply a certain [start-date], I'll get back all the Contracts of this Temp-Employee that have that [start-date]". Kind of like a hashtable where [start-date] is the hash key. So it could be 1-to-many, or 1-to-1, that's up to you and the specific of your problem domain. – Filip Milovanović Jul 24 '21 at 19:27
  • @filip "although there's an extension for database modeling" can you please provide a link for that? – igobivo Nov 08 '21 at 10:06
  • @igobivo See for example [this](https://www.eetimes.com/database-modeling-in-uml/) (scroll down to where it says "The UML Data Model Profile") - it's probably based on [this](http://www.mario-jeckle.de/files/RationalUML-RDB-Profile.pdf) (pdf). UML has this notion of "[profiles](https://en.wikipedia.org/wiki/Profile_(UML))" that allow you to extend it for your own needs. – Filip Milovanović Nov 08 '21 at 13:14

1 Answers1

2

Indeed the qualifier in your diagram reduces the multiplicity at the association end: it means that for a given start date a given (instance of) TEMP-EMPLOYEE has at most one CONTRACT.

If you would remove the qualifier of your model, you’d write that a TEMP-EMPLOYEE has 0..* CONTRACT, since there could be a different contract for every start-date.

Important remarks:

  • nothing is said in your diagram about the multiplicity at the qualified end. You assume it to be one, but is could be many (i.e. a multipartite contract with several employees starting for the same contract at the same date cannot be excluded). I’d recommend to remove this ambiguity and if you mean 1, just write it down. In this case we could say one to one qualified. Otherwise we cannot answer your question.
  • the ID annotation is not UML. There is an {id} modifier but the UML specification leave its meaning open since each class instance has anyway its own identity, regardless of its attributes. One common trick is to define a database modelling profile with custom stereotypes for identifying keys more precisely (see Scott Ambler’s article).
Christophe
  • 74,672
  • 10
  • 115
  • 187
  • Thanks for the post. May I clarify by qualified end, it will be `start-date` end? – Sunny J Jul 24 '21 at 13:01
  • @SunnyJ - yes. The `start-date` is called the "qualifier" (that just means that it can be used to categorize (qualify) the objects at the other end (the contracts) into different groups). So the "qualified end" here refers to the side that has a "qualifier" associated with it (besides, that's where no multiplicity is explicitly shown in your diagram). – Filip Milovanović Jul 24 '21 at 19:37