The relationship's type

Understanding Relationship Types


DEF1X supports three relationship types:

  • Identifying
  • Non-Identifying
  • Non-Specific

The selection of relationship types is fundamental to the referential integrity built into your data models. To help you select the relationship type appropriate to your environment, each of the supported relationship types is described below.

Identifying Relationships

Identifying relationships propagate the parent entity's primary key to the child's primary key. In the IDEF1X notation, identifying relationships are drawn as solid lines with a solid circle terminating the child entity.

Non-Identifying Relationships

Non-identifying relationships propagate the parent entity's primary key to the non-key attributes of the child. In the IDEF1X notation, non-identifying relationships are drawn as dashed lines with a solid circle terminating the child entity. If the non-identifying relationship is optional, then a hollow diamond terminates the parent entity.

Non-Specific Relationships

Non-specific relationships denote many-to-many relationships. Because many-to-many relationships cannot be resolved, non-specific relationships do not propagate any foreign keys. Many-to-many relationships are undesirable and should be removed as you normalize your data model. In the IDEF1X notation, non-specific relationships are drawn as solid lines with solid circles terminating both entities.

Relationship Types and Compound Keys

Think carefully about the use of different relationship types and its implications concerning identification. Identifying relationships propagate primary keys as primary keys to child entities, resulting in compound keys. The use of compound keys is often valid and appropriate. However, you should use them only when needed since they limit the flexibility of your data model. Whenever you use a compound key, this means that the data contained in the child entity can only be identified in the context of its parent. If you ever need to use the data independently, then you will have a problem.

原文地址:https://www.cnblogs.com/enli/p/41341.html