Skip to main content
I highlighted the statements describing the different class' relationships, to emphasize on their reading.
Source Link
Laiv
  • 14.8k
  • 2
  • 33
  • 71

In OOP, the relation "A derives from B" A derives from B (or A inherits from BA inherits from B) means that A is a kind of BA is a kind of B and that A can be passed to any function that expects to receive a BA can be passed to any function that expects to receive a B. This relation is valid when the sentence "A is a B"A is a B makes sense.
This

This is a different kind of "derives" than in your case of the Reynold's Risk Score and lab measurements.

The composition relation indicates a part-whole relationship. This relation is valid when the sentence "A consists of B (and more)"A consists of B (and more) makes sense. To my understanding, the Reynold's Risk Score does not consist of lab measurements, but it is calculated from them. That means that a simple association models the relationship best.

For the second scenario, the clinician probably has to know about both the Reynold's Risk Score (to see how it changes) and the lab measurements (to change them), so an association with both would be appropriate.

In OOP, the relation "A derives from B" (or A inherits from B) means that A is a kind of B and that A can be passed to any function that expects to receive a B. This relation is valid when the sentence "A is a B" makes sense.
This is a different kind of "derives" than in your case of the Reynold's Risk Score and lab measurements.

The composition relation indicates a part-whole relationship. This relation is valid when the sentence "A consists of B (and more)" makes sense. To my understanding, the Reynold's Risk Score does not consist of lab measurements, but it is calculated from them. That means that a simple association models the relationship best.

For the second scenario, the clinician probably has to know about both the Reynold's Risk Score (to see how it changes) and the lab measurements (to change them), so an association with both would be appropriate.

In OOP, the relation A derives from B (or A inherits from B) means that A is a kind of B and that A can be passed to any function that expects to receive a B. This relation is valid when the sentence A is a B makes sense.

This is a different kind of "derives" than in your case of the Reynold's Risk Score and lab measurements.

The composition relation indicates a part-whole relationship. This relation is valid when the sentence A consists of B (and more) makes sense. To my understanding, the Reynold's Risk Score does not consist of lab measurements, but it is calculated from them. That means that a simple association models the relationship best.

For the second scenario, the clinician probably has to know about both the Reynold's Risk Score (to see how it changes) and the lab measurements (to change them), so an association with both would be appropriate.

Source Link
Bart van Ingen Schenau
  • 76.7k
  • 20
  • 125
  • 189

In OOP, the relation "A derives from B" (or A inherits from B) means that A is a kind of B and that A can be passed to any function that expects to receive a B. This relation is valid when the sentence "A is a B" makes sense.
This is a different kind of "derives" than in your case of the Reynold's Risk Score and lab measurements.

The composition relation indicates a part-whole relationship. This relation is valid when the sentence "A consists of B (and more)" makes sense. To my understanding, the Reynold's Risk Score does not consist of lab measurements, but it is calculated from them. That means that a simple association models the relationship best.

For the second scenario, the clinician probably has to know about both the Reynold's Risk Score (to see how it changes) and the lab measurements (to change them), so an association with both would be appropriate.