0

I have a situation where the key of two tables will map to one row of a third table.

For example, let's say that each combination of classroom and topic will map to one teacher.

How can I represent that any tuplet (classroom, topic) is a one to one relationship with a teacher ?

Vaibhav Mule
  • 5,016
  • 4
  • 35
  • 52
BlueTrin
  • 9,610
  • 12
  • 49
  • 78
  • 1
    [`UML Association Class`](http://stackoverflow.com/questions/4744466/when-to-use-uml-association-classes) may be the technical term you're looking for – xmojmr Apr 19 '15 at 10:39

1 Answers1

2

I would simply model that as an aggregation like so:

enter image description here

Using an association class like pointed out by @xmojmr would probably only make sense if there is some operation connected (as the posted link also states).

Whether you use a simple association or a composition between Course and Teacher depends on your domain. The shown way will fix it and a course only exists if all 3 parts are defined. Using a simple association will tell that a course virtually exists and can be held by an arbitrary teacher. Still then topic/class room relate as tuple to a teacher.

qwerty_so
  • 35,448
  • 8
  • 62
  • 86