34.19. How to Represent Relationships in Tables

The code in the prior section relies on a MANU_OID foreign key in the PRODUCT_SPEC table to link to a record in the MANUFACTURER table. This highlights the question: How are object relationships represented in the relational model?

The answer is given in the Representing Object Relationships as Tables pattern {BW96], which proposes the following:

  • one-to-one associations

    • Place an OID foreign key in one or both tables representing the objects in relationship.

    • Or, create an associative table that records the OIDs of each object in relationship.

  • one-to-many associations, such as a collection

    • Create an associative table that records the OIDs of each object in relationship.

  • many-to-many associations

    • Create ...

Get Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.